- Notifications
You must be signed in to change notification settings - Fork30
lagom: A PyTorch infrastructure for rapid prototyping of reinforcement learning algorithms.
License
zuoxingdong/lagom
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A PyTorch infrastructure for rapid prototyping of reinforcement learning algorithms.
lagom is a 'magic' word in Swedish,inte för mycket och inte för lite, enkelhet är bäst (not too much and not too little, simplicity is often the best). It is the philosophy on which this library was designed.
lagom
balances between the flexibility and the usability when developing reinforcement learning (RL) algorithms. The library is built on top ofPyTorch and provides modular tools to quickly prototype RL algorithms. However, it does not go overboard, because too low level is often time consuming and prone to potential bugs, while too high level degrades the flexibility which makes it difficult to try out some crazy ideas fast.
We are continuously makinglagom
more 'self-contained' to set up and run experiments quickly. It internally supports base classes for multiprocessing (master-worker framework) for parallelization (e.g. experiments and evolution strategies). It also supports hyperparameter search by defining configurations either as grid search or random search.
Table of Contents
We highly recommand using an Miniconda environment:
conda create -n lagom python=3.7
pip install -r requirements.txt
We also provide some bash scripts inscripts/ directory to automatically set up the system configurations, conda environment and dependencies.
git clone https://github.com/zuoxingdong/lagom.gitcd lagompip install -e.
Installing from source allows to flexibly modify and adapt the code as you pleased, this is very convenient for research purpose.
The documentation hosted by ReadTheDocs is available online athttp://lagom.readthedocs.io
We implemented a collection of standard reinforcement learning algorithms atbaselines using lagom.
A common pipeline to uselagom
can be done as following:
- Define yourRL agent
- Define yourenvironment
- Define yourengine for training and evaluating the agent in the environment.
- Define yourConfigurations for hyperparameter search
- Define
run(config, seed, device)
for your experiment pipeline - Call
run_experiment(run, config, seeds, num_worker)
to parallelize your experiments
A graphical illustration is coming soon.
We provide a few simpleexamples.
We are usingpytest for tests. Feel free to run via
pytesttest -v
2019-03-04 (v0.0.3)
- Much easier and cleaner APIs
2018-11-04 (v0.0.2)
- More high-level API designs
- More unit tests
2018-09-20 (v0.0.1)
- Initial release
This repo is inspired byOpenAI Gym,OpenAI baselines,OpenAI Spinning Up
Please use this bibtex if you want to cite this repository in your publications:
@misc{lagom, author = {Zuo, Xingdong}, title = {lagom: A PyTorch infrastructure for rapid prototyping of reinforcement learning algorithms}, year = {2018}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {\url{https://github.com/zuoxingdong/lagom}}, }
About
lagom: A PyTorch infrastructure for rapid prototyping of reinforcement learning algorithms.