{"id":13717300,"url":"https://github.com/zuoxingdong/lagom","last_synced_at":"2025-08-02T01:14:20.840Z","repository":{"id":37431235,"uuid":"114990223","full_name":"zuoxingdong/lagom","owner":"zuoxingdong","description":"lagom: A PyTorch infrastructure for rapid prototyping of reinforcement learning algorithms.","archived":false,"fork":false,"pushed_at":"2022-11-19T05:52:37.000Z","size":100579,"stargazers_count":376,"open_issues_count":16,"forks_count":31,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-08-01T00:30:59.262Z","etag":null,"topics":["artificial-intelligence","cem","cmaes","ddpg","deep-deterministic-policy-gradient","deep-learning","deep-reinforcement-learning","evolution-strategies","machine-learning","mujoco","policy-gradient","ppo","proximal-policy-optimization","python","pytorch","reinforcement-learning","research","sac","soft-actor-critic","td3"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/zuoxingdong.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}},"created_at":"2017-12-21T09:51:28.000Z","updated_at":"2025-07-20T12:48:58.000Z","dependencies_parsed_at":"2023-01-20T21:18:21.110Z","dependency_job_id":null,"html_url":"https://github.com/zuoxingdong/lagom","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/zuoxingdong/lagom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuoxingdong%2Flagom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuoxingdong%2Flagom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuoxingdong%2Flagom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuoxingdong%2Flagom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuoxingdong","download_url":"https://codeload.github.com/zuoxingdong/lagom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuoxingdong%2Flagom/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268157910,"owners_count":24204768,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["artificial-intelligence","cem","cmaes","ddpg","deep-deterministic-policy-gradient","deep-learning","deep-reinforcement-learning","evolution-strategies","machine-learning","mujoco","policy-gradient","ppo","proximal-policy-optimization","python","pytorch","reinforcement-learning","research","sac","soft-actor-critic","td3"],"created_at":"2024-08-03T00:01:20.474Z","updated_at":"2025-08-02T01:14:20.799Z","avatar_url":"https://github.com/zuoxingdong.png","language":"Jupyter Notebook","funding_links":[],"categories":["Pytorch \u0026 related libraries｜Pytorch \u0026 相关库","Pytorch \u0026 related libraries","Jupyter Notebook"],"sub_categories":["Other libraries｜其他库:","Other libraries:"],"readme":"\u003cp align='center'\u003e\n    \u003ca href='https://github.com/zuoxingdong/lagom/'\u003e\n        \u003cimg alt=\"\" src='docs/lagom.png' width=\"50\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003ch3 align='center'\u003e\n    lagom\n\u003c/h3\u003e\n\u003cp align='center'\u003e\n    A PyTorch infrastructure for rapid prototyping of reinforcement learning algorithms.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href='https://travis-ci.org/zuoxingdong/lagom'\u003e\u003cimg src='https://travis-ci.org/zuoxingdong/lagom.svg?branch=master'\u003e\u003c/a\u003e\n    \u003ca href='https://circleci.com/gh/zuoxingdong/lagom'\u003e\u003cimg src='https://circleci.com/gh/zuoxingdong/lagom.svg?style=svg'\u003e\u003c/a\u003e\n    \u003ca href='https://lagom.readthedocs.io/en/latest/?badge=latest'\u003e\u003cimg src='https://readthedocs.org/projects/lagom/badge/?version=latest'\u003e\u003c/a\u003e\n    \u003ca href='http://choosealicense.com/licenses/mit/'\u003e\u003cimg src='https://img.shields.io/badge/License-MIT-blue.svg'\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n[lagom](https://sv.wikipedia.org/wiki/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. \n\n## Why to use lagom ?\n`lagom` balances between the flexibility and the usability when developing reinforcement learning (RL) algorithms. The library is built on top of [PyTorch](https://pytorch.org/) 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. \n\nWe are continuously making `lagom` more 'self-contained' to set up and run experiments quickly. It internally supports base classes for multiprocessing ([master-worker framework](https://en.wikipedia.org/wiki/Master/slave_(technology))) for parallelization (e.g. experiments and evolution strategies). It also supports hyperparameter search by defining configurations either as grid search or random search. \n\n**Table of Contents**\n- [Installation](#installation)\n    - [Install dependencies](#install-dependencies)\n    - [Install lagom from source](#install-lagom-from-source)\n- [Documentation](#documentation)\n- [RL Baselines](#rl-baselines)\n- [How to use lagom](#how-to-use-lagom)\n    - [Examples](#examples)\n- [Test](#test)\n- [What's new](#What's-new)\n- [Reference](#reference)\n\n## Installation\nWe highly recommand using an Miniconda environment:\n```bash\nconda create -n lagom python=3.7\n```\n### Install dependencies\n```bash\npip install -r requirements.txt\n```\n\nWe also provide some bash scripts in [scripts/](scripts/) directory to automatically set up the system configurations, conda environment and dependencies.\n\n### Install lagom from source\n```bash\ngit clone https://github.com/zuoxingdong/lagom.git\ncd lagom\npip install -e .\n```\n\nInstalling from source allows to flexibly modify and adapt the code as you pleased, this is very convenient for research purpose. \n\n## Documentation\nThe documentation hosted by ReadTheDocs is available online at [http://lagom.readthedocs.io](http://lagom.readthedocs.io)\n\n## RL Baselines\nWe implemented a collection of standard reinforcement learning algorithms at [baselines](baselines/) using lagom. \n\n## How to use lagom\nA common pipeline to use `lagom` can be done as following:\n1. Define your [RL agent](lagom/agent.py)\n2. Define your [environment](lagom/envs)\n3. Define your [engine](lagom/engine.py) for training and evaluating the agent in the environment.\n4. Define your [Configurations](lagom/experiment/config.py) for hyperparameter search\n5. Define `run(config, seed, device)` for your experiment pipeline\n6. Call `run_experiment(run, config, seeds, num_worker)` to parallelize your experiments\n\nA graphical illustration is coming soon. \n\n### Examples\nWe provide a few simple [examples](examples/).\n\n## Test\nWe are using [pytest](https://docs.pytest.org) for tests. Feel free to run via\n\n```bash\npytest test -v\n```\n\n## What's new\n- 2019-03-04 (v0.0.3)\n    - Much easier and cleaner APIs\n\n- 2018-11-04 (v0.0.2)\n    - More high-level API designs\n    - More unit tests\n\n- 2018-09-20 (v0.0.1)\n    - Initial release\n\n## Reference\nThis repo is inspired by [OpenAI Gym](https://github.com/openai/gym/), [OpenAI baselines](https://github.com/openai/baselines), [OpenAI Spinning Up](https://github.com/openai/spinningup)\n\nPlease use this bibtex if you want to cite this repository in your publications:\n\n    @misc{lagom,\n          author = {Zuo, Xingdong},\n          title = {lagom: A PyTorch infrastructure for rapid prototyping of reinforcement learning algorithms},\n          year = {2018},\n          publisher = {GitHub},\n          journal = {GitHub repository},\n          howpublished = {\\url{https://github.com/zuoxingdong/lagom}},\n        }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuoxingdong%2Flagom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuoxingdong%2Flagom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuoxingdong%2Flagom/lists"}