Need help with Stack-RNN?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

421 Stars 93 Forks Other 38 Commits 4 Opened issues


This is the code used for the paper "Inferring algorithmic patterns with a stack augmented recurrent network", by Armand Joulin and Tomas Mikolov.

Services available


Need anything else?

Contributors list

Stack RNN

Stack RNN is a project gathering the code from the paper Inferring Algorithmic Patterns with Stack-Augmented Recurrent Nets by Armand Joulin and Tomas Mikolov (pdf). In this research project, we focus on extending Recurrent Neural Networks (RNN) with a stack to allow them to learn sequences which require some form of persistent memory.

Examples are given in the script
. The code is still under construction. We are working on releasing the code for the list RNN. If you have any suggestion, please let us know (contacts below).


To run the code on a task: ```

make toy ./traintoy -ntask 1 -nchar 2 -nhid 10 -nstack 1 -lr .1 -nmax 10 -depth 2 -bptt 50 -mod 1

To run the code on binary addition:
make add ./trainadd ```


Stack RNN works on: * Mac OS X * Linux

It was not tested on Windows. To compile the code a relatively recent version of g++ is required.

Building Stack RNN


to compile everything.


For more help about the options: ```

make toy ./traintoy --help ``

Note that

can take the same options as

Join the Stack RNN community

  • Paper:
  • Facebook page:
  • Contact: [email protected]

See the CONTRIBUTING file for how to help out.


Stack RNN is BSD-licensed. We also provide an additional patent grant

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.