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

About the developer

463 Stars 122 Forks Apache License 2.0 19 Commits 2 Opened issues


Learning to Execute

Services available


Need anything else?

Contributors list

# 42,354
4 commits
# 342,618
2 commits
# 25,848
1 commit
# 396,429
1 commit

Learning to Execute

This software allows to train a Recurrent Neural Network (RNN) with Long-Short Term Memory (LSTM) units on short snippets of python code. The Network is trained to predict the output of the generated programs.


Please install Torch 7 with the cunn package. Moreover, our software requires an NVIDIA GPU.

To execute the program, call:

torch main.lua

This program starts training the LSTM and displays intermediate results. main.lua can be executed with the following options:

torch main.lua -gpuidx 1 -target_length 6 -target_nesting 3
  • gpuidx: chooses a GPU for the program
  • target_length: is a maximum number of digits in every number generated in test programs in a test dataset.
  • target_nesting: is the depth of the nesting in the generated programs in the test dataset.

Moreover, the command

torch data.lua

verifies that training data is correct by evaluating 1000 samples with a python interpreter (python2.7 is required).

More information about the scientific work is provided at

This software is located at

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.