Giter Club home page Giter Club logo

rnn_ctc's Introduction

rnn_ctc

Recurrent Neural Network with Connectionist Temporal Classifical implemented in Theano. Includes a Toy training example.

Usage

Generate Data

First generate some data using one of the scribes (a, b or c)

# Run with '-h' to see full functionality of gen_data.py
python3 gen_data.py -h

a) Hindu numerals

python3 gen_data.py data.pkl -a hindu

b) ASCII characters.

python3 gen_data.py data.pkl -a ascii

c) scribe_rows scribes i-th digit along the i-th row as an i+2 long bar

python3 alphabets/scribe_rows.py data.pkl
# Run with no arguments to see full usage

Now you have the data.pkl file.

Train Network

Run the actual Recurrent Neural Net with Connectionist Temporal Classification cost function as:

python3 train.py data.pkl [configuration_num]
# Run with no arguments for full usage.

Sample Output

# Using data from scribe_rows.py
Shown : 0 2 3 1 0 1 0 2 1 2   
Seen  : 0 2 3 1 0 1 0 2 1 2   
Images (Shown & Seen) : 

 0¦    ██  ██ ██             ¦  
 1¦     ███  ███  ███        ¦  
 2¦    ████    ████  ████    ¦  
 3¦    █████                 ¦  

 0¦    █    ██ █▓            ¦  
 1¦       ██  █    ███       ¦  
 2¦     █       ▒██   ██▓    ¦  
 3¦      █                   ¦  
 4¦████                 ▒████¦  

# Using data from scribe.py hindu
Shown : 0 2 2 5 
Seen  : 0 2 2 5 
Images (Shown & Seen) : 

 0¦                            ¦
 1¦          ██  ██            ¦
 2¦         █  ██  ████        ¦
 3¦           █   █ █          ¦
 4¦      ██  █   █  ███        ¦
 5¦     █  █████████  █        ¦
 6¦     █  █        █ █        ¦
 7¦      ██         ███        ¦
 
 0¦░░░░░░░░░█░░░░░░░░░░░░░░░░░░¦
 1¦░░░░░░░░░░░░░░░░░░░░░░░░░░░░¦
 2¦░░░░░░░░░░░░░█░░░█░░░░░░░░░░¦
 3¦░░░░░░░░░░░░░░░░░░░░░░░░░░░░¦
 4¦░░░░░░░░░░░░░░░░░░░░░░░░░░░░¦
 5¦░░░░░░░░░░░░░░░░░░░█▓░░░░░░░¦
 6¦█████████░███░███░█░▒███████¦

References

  • Graves, Alex. Supervised Sequence Labelling with Recurrent Neural Networks. Chapters 2, 3, 7 and 9.
  • Available at Springer
  • University Edition via. Springer Link.
  • Free Preprint

Credits

Dependencies

  • Numpy
  • Theano

Can easily port to python2 by adding lines like these where necessary:

from __future__ import print_function

rnn_ctc's People

Contributors

rakeshvar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.