Learning to execute Python in Tensorflow and other Seq2seq examples
Python Jupyter Notebook
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
trained_model
README.md
addition_generator.py
data.py
date-normalization.ipynb
date_generator.py
learning-to-execute.ipynb
model.py
program_generator.py
train.py

README.md

Learning to execute Python in Tensorflow

Reimplementation of the paper Learning to execute in Tensorflow (0.7.0 and 0.8.0).

Original implementation in Torch: https://github.com/wojciechz/learning_to_execute

A Seq2Seq model is trained to execute simple Python programs.

Example:

Input:
g=6
a=-77
if a>2:
  g=a-4
print(a+g)
-----------
Target: -71
Model prediction: -71

The program generation code is simplified compared to the original paper but can easily be extended.

Date normalization

date-normalization.ipynb also contains a simple date format normalization example using the same model code.

PyCon Sweden

This work was presented at PyCon Sweden 2016, Stockholm. Presentation