• Stars
    star
    244
  • Rank 165,885 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NPI(Neural Programmer-Interpreters) implementation with Keras

About

Implementation of Neural Programmer-Interpreters with Keras.

How to Demo

Demo Movie

requirement

  • Python3

setup

pip install -r requirements.txt

create training dataset

create training dataset

sh src/run_create_addition_data.sh

create training dataset with showing steps on terminal

DEBUG=1 sh src/run_create_addition_data.sh

training model

Create New Model (-> remove old model if exists and then create new model)

NEW_MODEL=1 sh src/run_train_addition_model.sh

Training Existing Model (-> if a model exists, use the model)

sh src/run_train_addition_model.sh

test model

check the model accuracy

sh src/run_test_addition_model.sh

check the model accuracy with showing steps on terminal

DEBUG=1 sh src/run_test_addition_model.sh

Implementation FAQ

These are questions about implementation that I received in the past.

about pydot

Q: I am using Python3. I am getting an error "module 'pydot' has no attribute 'find_graphviz'".

A: Let's try pydot-ng.

train_f_enc method

Q: What is the purpose of 'env_model' in 'train_f_enc' method which gets called by 'fit' method? My guess is, it is to train the weights of 'f_enc' layer.

A: Yes, that's right.


Q: Why is the target output of 'env_model' - [[first digit of sum], [ carry of sum]]? Also, why does the target output not have 'output' As per my understanding the weights of 'f_enc' layer should be trained only in 'self.model'.

A: Yes, in the original paper, 'f_enc' is trained with other layers. It is better not to be trained separately.

The reason of that in my implementation is just difficulty to train the model. Especially it seemed to hard to train layers before LSTMs (like f_enc layer). f_enc weights often became some NaNs. (I don't know why... keras problem? or ??) So, I tried to train f_enc separately, and it seemed good (not best).

NOP program

Q: what's the purpose of NOP program?

A: I do not remember it much, but NOP (No Operation) is program_id = 0. I thought that in the early days of learning, the predicted value often becomes 0, and harmless NOPs that do not perform unnecessary movements will learn more efficiently. Although it is not certain whether it is effective...

weights = [[1.]]

Q: what's the purpose of weights = [[1.]] this initialization?

A: You mean weights = [[1.]] in AdditionNPIModel#convert_output(), don't you?

The weights means learning weights of [f_end, f_prog, f_args]. The first weights = [[1.]] means "f_end's weight=1". f_prog and f_args weights are set to 1 if the teacher returns valid values.

More Repositories

1

reversi-alpha-zero

Reversi reinforcement learning by AlphaGo Zero methods.
Python
676
star
2

CrashMonkey

Monkey Test Tool For iOS
Ruby
199
star
3

keras_BEGAN

Implementation BEGAN([Boundary Equilibrium Generative Adversarial Networks](https://arxiv.org/pdf/1703.10717.pdf)) by Keras.
Python
36
star
4

Android_NFC_FelicaEdit

FelicaEdit is an application which can view and edit FeliCa data using Android devices.
Java
28
star
5

docker_capture_web

Docker Container to take full screenshot of a web page
Python
21
star
6

EventCenter

Swift Library of Type Safe Event Notification like Android's EventBus.
Swift
13
star
7

AWSSimpleConsole

Amazon Web Service's EC2 SImple Console that can start/stop and scheduled start/stop.
Ruby
9
star
8

iBeaconNotifier

Objective-C
9
star
9

MemoryWarningSender

A Plugin of iOS Simulator send 'MemoryWarning' repeatedly.
Objective-C
8
star
10

reversi-arena

Python
7
star
11

CanvizPlain

Canviz(JavaScript xdot drawer using Canvas) without prototype.js
CoffeeScript
6
star
12

PlayingChainer

Python
6
star
13

DeepTransition

Objective-C
5
star
14

LyncToNotification

SIMBL Plugin of 'Microsoft Lync for mac' to send notifications to Notification Center(of Mountain Lion).
Objective-C
5
star
15

jupyter-tensorflow

Shell
4
star
16

android_refactor_training

Java
4
star
17

reversi-alpha-zero-models

Models trained by reversi-alpha-zero
3
star
18

ObjectJsonMapperGenerator

Ruby
3
star
19

moke_config

This is a config utility for tree structure, PyCharm complement and overriding by dictionary.
Python
2
star
20

UnityChanRoadRunner

C#
2
star
21

fluent-plugin-basecreate

create a fluent plugin development environment with Bundle gem.
Ruby
2
star
22

CheckRelease

Check Tool of PROPERTY Release in Objective-C
Python
2
star
23

rust_wasm_example

Rust
2
star
24

openai

Python
1
star
25

FileTransfer

JavaScript
1
star
26

walk88

Ruby
1
star
27

embulk-encoder-encrypted_zip

Java
1
star
28

senpai-tasukete

Test Environment of https://paiza.jp/poh/ec-campaign
Shell
1
star
29

obstacle_tower

Python
1
star
30

spr_adbi

Python
1
star
31

embulk-parser-regex

Java
1
star
32

scaf_code

scaf_code is a tool for generating code from reference and specification files by Large Language Models.
Python
1
star
33

docker-python39-chrome99

Dockerfile
1
star
34

tv_info

Python
1
star
35

UnitySmartPhoneInputController

Unity Input Controller with SmartPhone using WebSocket.
C#
1
star