Giter Club home page Giter Club logo

alphanpi2's Introduction

AlphaNPI

Adapting the AlphaZero algorithm to remove the need of execution traces to train NPI.

Setup

You need to install the required Python packages.

cd alphanpi/

Then run the command:

pip install -r requirements.txt

Update the following environment variable:

export PYTHONPATH=$PWD:$PYTHONPATH

Training

cd trainings/

Run one of the scripts:

python train_recursive_sorting.py --tensorboard --verbose --save-model --save-results --save-model
python train_hanoi.py --tensorboard --verbose --save-model --save-results --save-model
python train_sorting_nohierarchy.py --tensorboard --verbose --save-model --save-results --save-model
python train_hanoi.py --tensorboard --verbose --save-model --save-results --save-model

For more information about the arguments that can be sent, see at trainings/README.md

Validation

The following allows to assert the results disclosed in the paper

cd validation/

Then run one of the scripts:

python validate_hanoi.py --verbose --save-results
python validate_recursive_sorting.py --verbose --save-results
python validate_sorting.py --verbose --save-results
python validate_sorting_nohierarchy.py --verbose --save-results

For more information about the arguments that can be sent, see at validation/README.md

Visualization

cd visualization/

To visualize a pre-trained model behavior for an environment env, run the script visualize_{env}.py. Set the load path at the beginning of the script to the path where the model of interest is saved.

Run one of the scripts:

python visualize_hanoi.py
python visualize_recursive_sorting.py
python visualize_sorting.py
python visualize_sorting_nohierarchy.py

Generate visualization

When a visualization script is executed, it generates a mcts.gv file under visualization/. The file contains a description of the tree in dot language.

If you don't already have graphviz installed, run command:

sudo apt-get install python3-pydot graphviz

To convert the .gv in .pdf file, use command:

dot -Tpdf mcts.gv -o mcts.pdf

alphanpi2's People

Contributors

geektoni avatar guillaumel-instadeep avatar ranzentom avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

odellus

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.