{"id":24811860,"url":"https://github.com/instadeepai/alphanpi","last_synced_at":"2025-11-03T18:28:49.601Z","repository":{"id":40984106,"uuid":"188819422","full_name":"instadeepai/AlphaNPI","owner":"instadeepai","description":"Adapting the AlphaZero algorithm to remove the need of execution traces to train NPI.","archived":false,"fork":false,"pushed_at":"2023-10-03T22:41:42.000Z","size":51,"stargazers_count":76,"open_issues_count":6,"forks_count":15,"subscribers_count":9,"default_branch":"master","last_synced_at":"2023-10-20T20:24:18.905Z","etag":null,"topics":["deep-learning","deep-reinforcement-learning","machine-learning","neural-networks","neural-program-synthesis","neural-programmer-interpreter","reinforcement-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instadeepai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-27T10:06:28.000Z","updated_at":"2023-10-21T11:55:58.642Z","dependencies_parsed_at":"2023-01-23T16:30:10.561Z","dependency_job_id":"56829825-9791-47b5-8ce8-f6ddb4b72e1f","html_url":"https://github.com/instadeepai/AlphaNPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instadeepai%2FAlphaNPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instadeepai%2FAlphaNPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instadeepai%2FAlphaNPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instadeepai%2FAlphaNPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instadeepai","download_url":"https://codeload.github.com/instadeepai/AlphaNPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236353165,"owners_count":19135501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","deep-reinforcement-learning","machine-learning","neural-networks","neural-program-synthesis","neural-programmer-interpreter","reinforcement-learning"],"created_at":"2025-01-30T13:16:35.510Z","updated_at":"2025-10-13T13:31:44.800Z","avatar_url":"https://github.com/instadeepai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AlphaNPI\n\nAdapting the AlphaZero algorithm  to remove the need of execution traces to train NPI.\n\n## Setup\nYou need to install the required Python packages.\n\n    cd alphanpi/\n\nThen run the command:\n\n    pip install -r requirements.txt\n\n\nUpdate the following environment variable:\n\n    export PYTHONPATH=$PWD:$PYTHONPATH\n\n## Training\n\n    cd trainings/\n\nRun one of the scripts:\n\n    python train_recursive_sorting.py --tensorboard --verbose --save-model --save-results --save-model\n    python train_hanoi.py --tensorboard --verbose --save-model --save-results --save-model\n    python train_sorting_nohierarchy.py --tensorboard --verbose --save-model --save-results --save-model\n    python train_hanoi.py --tensorboard --verbose --save-model --save-results --save-model\nFor more information about the arguments that can be sent, see at trainings/README.md\n    \n\n## Validation\n\nThe following allows to assert the results disclosed in the paper\n\n    cd validation/\n\nThen run one of the scripts:\n\n\n    python validate_hanoi.py --verbose --save-results\n    python validate_recursive_sorting.py --verbose --save-results\n    python validate_sorting.py --verbose --save-results\n    python validate_sorting_nohierarchy.py --verbose --save-results\nFor more information about the arguments that can be sent, see at validation/README.md\n\n    \n## Visualization\n\n    cd visualization/\n\nTo 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.\n\nRun one of the scripts:\n\n    python visualize_hanoi.py\n    python visualize_recursive_sorting.py\n    python visualize_sorting.py\n    python visualize_sorting_nohierarchy.py\n    \n    \n### Generate visualization\nWhen a visualization script is executed, it generates a **mcts.gv** file under visualization/. The file contains a description of the tree in dot language. \n\nIf you don't already have graphviz installed, run command:\n\n    sudo apt-get install python3-pydot graphviz\n\nTo convert the .gv in .pdf file, use command:\n\n    dot -Tpdf mcts.gv -o mcts.pdf\n\n\n\n    \n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstadeepai%2Falphanpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstadeepai%2Falphanpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstadeepai%2Falphanpi/lists"}