Code Monkey home page Code Monkey logo

neural-program-learning-project's Introduction

This program is attempt to adapt NPI (Neural Program Interpreter https://arxiv.org/pdf/1511.06279.pdf) implementation. The codes for the projects were adapted and made needed changes from the https://github.com/siddk/npi
Package required:
* Tensorflow
* Tflearn
* Numpy (if not already installed)
* Pickle (if not already installed)

You can use NPI_Country_Region.ipynb file and having all other files in the same folder except for the separate folder for model named as model.
The cells header of the .ipynb file explains the use of the cell i.e. generate data, train, plot, evaluate or test.

Alternatively, the files description can be as follows:
create_program_data -> for creating the trace of the data
train.py -> for training the data
eval.py -> for testing or evaluating of the data on randomly picked data

Note that to continue press โ€œcโ€ while running the eval.py or testing/evaluation cell in .ipynb file.

Example of trace from the cell would be:
To find:  Angola

--------  Environment ----------
>  Angola   None
>  Nepal   Asia
>  India   Asia
>  China   Asia
>  Peru   North America
>  Brazil   North America
>  UK   Europe
>  Sudan   Africa
>  Italy   Europe
>  Sweden   Europe
>  Mexico   North America
>  USA   North America
>  Angola   Africa
>  Bangladesh   Asia
>  Japan   Asia
>  Egypt   Africa
>  Nigeria   Africa
>  None   None

-----------------------------------
Step: FIND, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Continue? c
Step: INCREMENT, Arguments: [], Terminate: False
Step: INCREMENT, Arguments: [], Terminate: True
>  Angola   None
>  Nepal   Asia
>  India   Asia
>  China   Asia
>  Peru   North America
>  Brazil   North America
>  UK   Europe
>  Sudan   Africa
>  Italy   Europe
>  Sweden   Europe
>  Mexico   North America
>  USA   North America
>  Angola   Africa
>  Bangladesh   Asia
>  Japan   Asia
>  Egypt   Africa
>  Nigeria   Africa
>  None   None

Pointer at  12
-------- KB Environment ----------
>  Angola   None
>  Nepal   Asia
>  India   Asia
>  China   Asia
>  Peru   North America
>  Brazil   North America
>  UK   Europe
>  Sudan   Africa
>  Italy   Europe
>  Sweden   Europe
>  Mexico   North America
>  USA   North America
>  Angola   Africa
>  Bangladesh   Asia
>  Japan   Asia
>  Egypt   Africa
>  Nigeria   Africa
>  Africa   None

--------------------------------------------------------------------------
Model Output:  Africa
Correct Out :  Africa
Correct!

 



neural-program-learning-project's People

Contributors

nsitaula avatar

Stargazers

 avatar  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.