Machin is a reinforcement library designed for pytorch.
Reinforcement learning library(framework) designed for PyTorch, implements DQN, DDPG, A2C, PPO, SAC, MADDPG, A3C, APEX, IMPALA ...
Starting from version 0.4.0, Machin now supports automatic config generation, you can get a configuration
python -m machin.auto generate --algo DQN --env openai_gym --output config.json
And automatically launch the experiment with pytorch lightning:
python -m machin.auto launch --config config.json
All algorithms in Machin are designed with minimial abstractions and have very detailed documents, as well as various helpful tutorials.
Machin takes a similar approach to that of pytorch, encasulating algorithms, data structures in their own classes. Users do not need to setup a series of
samplers... to use them, just import.
The only restriction placed on your models is their input / output format, however, these restrictions are minimal, making it easy to adapt algorithms to your custom environments.
Machin is built upon pytorch, it and thanks to its powerful rpc api, we may construct complex distributed programs. Machin provides implementations for enhanced parallel execution pools, automatic model assignment, role based rpc scaling, rpc service discovery and registration, etc.
Upon these core functions, Machin is able to provide tested high-performance distributed training algorithm implementations, such as A3C, APEX, IMPALA, to ease your design.
Machin is weakly reproducible, for each release, our test framework will directly train every RL framework, if any framework cannot reach the target score, the test will fail directly.
However, currently, the tests are not guaranteed to
be exactly the same as the tests in original papers, due to the large variety of different environments used in original research papers.
Machin is hosted on PyPI. Python >= 3.6 and PyTorch >= 1.6.0 is required. You may install the Machin library by simply typing:
pip install machin
You are suggested to create a virtual environment first if you are using conda to manage your environments, to prevent PIP changes your packages without letting
conda create -n some_env pip conda activate some_env pip install machin
Note: Currently only a fraction of all functions is supported on Windows, to test whether
the code is running correctly, you can run the corresponding test script in the root directory: