GitRead 中文社区
首页趋势排行榜原创文章严选周刊
更多资源
新手训练营
精选专题热门话题GitHub 文档资源精选实战指南

DI-engine

OpenDILab Decision AI Engine. The Most Comprehensive Reinforcement Learning Framework B.P.

  • 语言Python
  • 默认分支main
  • 大小299.9 MB
  • 更新2025年12月7日
  • Issues26
在 GitHub 打开
avataropendilab

项目介绍

opendilab/DI-engine 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 Apache License 2.0 许可证,目前获得 3.6k 个 Star、433 次 Fork。

仓库全名
opendilab/DI-engine

README 摘要

Updated on 2024.12.23 DI-engine-v0.5.3 Introduction to DI-engine Documentation | 中文文档 | Tutorials | Feature | Task & Middleware | TreeTensor | Roadmap DI-engine is a generalized decision intelligence engine for PyTorch and JAX. It provides python-first and asynchronous-native task and middleware abstractions, and modularly integrates several of the most important decision-making concepts: Env, Policy and Model…

完整内容见 GitHub 原始 README 或本页 。

常见问题

DI-engine 用什么语言开发?

主要使用 Python 编写,采用 Apache License 2.0 许可证,目前有 3.6k 个 Star。

DI-engine 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 DI-engine 的源码?

可以直接克隆仓库:git clone https://github.com/opendilab/DI-engine.git,默认分支为 main;安装与运行步骤见仓库 README。

DI-engine 最近还在维护吗?

仓库最近一次更新为 2025年12月7日,当前有 26 个未关闭 Issue;Star 数为 3.6k,可作为社区活跃度的参考。

本页面展示项目元数据与原始 README,GitRead 中文社区 编辑团队负责选题收录。

相关仓库

public-apis/public-apis avatar
public-apispublic-apis
2 天前
497.8k
55.7k
2.6k

免费 API 汇总列表

apipublic-apisfree+7
Python
15.5 MB
7
详情
EbookFoundation/free-programming-books avatar
free-programming-booksEbookFoundation
3 天前
401.4k
67.6k
96

免费可获取的编程书籍

bookseducationhacktoberfest+2
Python
21.8 MB
3
详情
donnemartin/system-design-primer avatar
system-design-primerdonnemartin
9月15日
377.5k
59.3k
645

学习如何设计大规模系统。为系统设计面试做准备。包含 Anki 闪卡。

designdesign-patternsdesign-system+10
Python
11.0 MB
0
详情
vinta/awesome-python avatar
awesome-pythonvinta
2 天前
333.8k
29.1k
21

回答“我想用 Python 做 X,该用哪个工具?”的权威清单

awesomeawesome-listpython+3
Python
6.9 MB
2
详情
practical-tutorials/project-based-learning avatar
project-based-learningpractical-tutorials
1 天前
289.5k
36.2k
154

精选的项目实战教程列表

tutorialprojectbeginner-project+5
Python
472 KB
1
详情
NousResearch/hermes-agent avatar
hermes-agentNousResearch
3 小时前
262.3k
58.5k
53.9k

与你共同成长的智能体

aiai-agentai-agents+10
Python
1.4 GB
3
详情
TheAlgorithms/Python avatar
PythonTheAlgorithms
1 周前
226.0k
51.3k
91

所有算法均用 Python 实现

algorithmalgorithm-competitionsalgorithms-implemented+11
Python
17.9 MB
2
详情
yt-dlp/yt-dlp avatar
yt-dlpyt-dlp
6 天前
206.7k
18.0k
2.1k

功能丰富的命令行音视频下载器

youtube-dlpythonsponsorblock+4
Python
63.5 MB
0
详情

关于

ataridistributed-reinforcement-learningdistributed-systemdrlexploration-exploitationimitation-learningimpalainverse-reinforcement-learningminigridmodel-based-reinforcement-learningmujocomultiagent-reinforcement-learningoffline-rlpythonpytorch-rlr2d2reinforcement-learningreinforcement-learning-algorithmsself-playsmac
  • Apache License 2.0
  • 3.6k Stars
  • 433 Forks
  • 23 Watching

简要分析

热度分
4538
价值分
2320
活跃状态
活跃
GitHub

语言占比

Makefile
Python
Shell

Release

  • v0.5.32024年12月23日
  • v0.5.22024年6月27日
  • v0.5.12024年2月4日
  • v0.5.02023年12月5日
  • v0.4.92023年8月23日

贡献者

PaParaZz1PaParaZz1puyuan1996puyuan1996zjowowenzjowowensailxjxsailxjxWeiyuhong-1998Weiyuhong-1998kxzxvbkkxzxvbknighoodnighooddavide97ldavide97lWill-NieWill-NieLuciusMosLuciusMosYinminZhangYinminZhangkarroyankarroyan

Twitter PyPI Conda Conda update PyPI - Python Version PyTorch Version

Loc Comments

Style Read en Docs Read zh_CN Docs Unittest Algotest deploy codecov

GitHub Org's stars GitHub stars GitHub forks GitHub commit activity GitHub issues GitHub pulls Contributors GitHub license Hugging Face Open in OpenXLab discord badge slack badge

Featured|HelloGitHub

Updated on 2024.12.23 DI-engine-v0.5.3

Introduction to DI-engine

Documentation | 中文文档 | Tutorials | Feature | Task & Middleware | TreeTensor | Roadmap

DI-engine is a generalized decision intelligence engine for PyTorch and JAX.

It provides python-first and asynchronous-native task and middleware abstractions, and modularly integrates several of the most important decision-making concepts: Env, Policy and Model. Based on the above mechanisms, DI-engine supports various deep reinforcement learning algorithms with superior performance, high efficiency, well-organized documentation and unittest:

  • Most basic DRL algorithms: such as DQN, Rainbow, PPO, TD3, SAC, R2D2, IMPALA
  • Multi-agent RL algorithms: such as QMIX, WQMIX, MAPPO, HAPPO, ACE
  • Imitation learning algorithms (BC/IRL/GAIL): such as GAIL, SQIL, Guided Cost Learning, Implicit BC
  • Offline RL algorithms: BCQ, CQL, TD3BC, Decision Transformer, EDAC, Diffuser, Decision Diffuser, SO2
  • Model-based RL algorithms: SVG, STEVE, MBPO, DDPPO, DreamerV3
  • Exploration algorithms: HER, RND, ICM, NGU
  • LLM + RL Algorithms: PPO-max, DPO, PromptPG, PromptAWR
  • Other algorithms: such as PER, PLR, PCGrad
  • MCTS + RL algorithms: AlphaZero, MuZero, please refer to LightZero
  • Generative Model + RL algorithms: Diffusion-QL, QGPO, SRPO, please refer to GenerativeRL

DI-engine aims to standardize different Decision Intelligence environments and applications, supporting both academic research and prototype applications. Various training pipelines and customized decision AI applications are also supported:

(Click to Collapse)
  • Traditional academic environments

    • DI-zoo: various decision intelligence demonstrations and benchmark environments with DI-engine.
  • Tutorial courses

    • PPOxFamily: PPO x Family DRL Tutorial Course
  • Real world decision AI applications

    • DI-star: Decision AI in StarCraftII
    • PsyDI: Towards a Multi-Modal and Interactive Chatbot for Psychological Assessments
    • DI-drive: Auto-driving platform
    • DI-sheep: Decision AI in 3 Tiles Game
    • DI-smartcross: Decision AI in Traffic Light Control
    • DI-bioseq: Decision AI in Biological Sequence Prediction and Searching
    • DI-1024: Deep Reinforcement Learning + 1024 Game
  • Research paper

    • InterFuser: [CoRL 2022] Safety-Enhanced Autonomous Driving Using Interpretable Sensor Fusion Transformer
    • ACE: [AAAI 2023] ACE: Cooperative Multi-agent Q-learning with Bidirectional Action-Dependency
    • GoBigger: [ICLR 2023] Multi-Agent Decision Intelligence Environment
    • DOS: [CVPR 2023] ReasonNet: End-to-End Driving with Temporal and Global Reasoning
    • LightZero: [NeurIPS 2023 Spotlight] A lightweight and efficient MCTS/AlphaZero/MuZero algorithm toolkit
    • SO2: [AAAI 2024] A Perspective of Q-value Estimation on Offline-to-Online Reinforcement Learning
    • LMDrive: [CVPR 2024] LMDrive: Closed-Loop End-to-End Driving with Large Language Models
    • SmartRefine: [CVPR 2024] SmartRefine: A Scenario-Adaptive Refinement Framework for Efficient Motion Prediction
    • ReZero: Boosting MCTS-based Algorithms by Backward-view and Entire-buffer Reanalyze
    • UniZero: Generalized and Efficient Planning with Scalable Latent World Models
  • Docs and Tutorials

    • DI-engine-docs: Tutorials, best practice and the API reference.
    • awesome-model-based-RL: A curated list of awesome Model-Based RL resources
    • awesome-exploration-RL: A curated list of awesome exploration RL resources
    • awesome-decision-transformer: A curated list of Decision Transformer resources
    • awesome-RLHF: A curated list of reinforcement learning with human feedback resources
    • awesome-multi-modal-reinforcement-learning: A curated list of Multi-Modal Reinforcement Learning resources
    • awesome-diffusion-model-in-rl: A curated list of Diffusion Model in RL resources
    • awesome-ui-agents: A curated list of of awesome UI agents resources, encompassing Web, App, OS, and beyond
    • awesome-AI-based-protein-design: a collection of research papers for AI-based protein design
    • awesome-end-to-end-autonomous-driving: A curated list of awesome End-to-End Autonomous Driving resources
    • awesome-driving-behavior-prediction: A collection of research papers for Driving Behavior Prediction

On the low-level end, DI-engine comes with a set of highly re-usable modules, including RL optimization functions, PyTorch utilities and auxiliary tools.

BTW, DI-engine also has some special system optimization and design for efficient and robust large-scale RL training:

(Click for Details)
  • treevalue: Tree-nested data structure
  • DI-treetensor: Tree-nested PyTorch tensor Lib
  • DI-toolkit: A simple toolkit package for decision intelligence
  • DI-orchestrator: RL Kubernetes Custom Resource and Operator Lib
  • DI-hpc: RL HPC OP Lib
  • DI-store: RL Object Store

Have fun with exploration and exploitation.

Outline

  • Introduction to DI-engine
  • Outline
  • Installation
  • Quick Start
  • Feature
    • Algorithm Versatility
    • Environment Versatility
    • General Data Container: TreeTensor
  • Feedback and Contribution
  • Supporters
    • ↳ Stargazers
    • ↳ Forkers
  • Citation
  • License

Installation

You can simply install DI-engine from PyPI with the following command:

pip install DI-engine

For more information about installation, you can refer to installation.

And our dockerhub repo can be found here,we prepare base image and env image with common RL environments.

(Click for Details)
  • base: opendilab/ding:nightly
  • rpc: opendilab/ding:nightly-rpc
  • atari: opendilab/ding:nightly-atari
  • mujoco: opendilab/ding:nightly-mujoco
  • dmc: opendilab/ding:nightly-dmc2gym
  • metaworld: opendilab/ding:nightly-metaworld
  • smac: opendilab/ding:nightly-smac
  • grf: opendilab/ding:nightly-grf
  • cityflow: opendilab/ding:nightly-cityflow
  • evogym: opendilab/ding:nightly-evogym
  • d4rl: opendilab/ding:nightly-d4rl

The detailed documentation are hosted on doc | 中文文档.

Quick Start

3 Minutes Kickoff

3 Minutes Kickoff (colab)

DI-engine Huggingface Kickoff (colab)

How to migrate a new RL Env | 如何迁移一个新的强化学习环境

How to customize the neural network model | 如何定制策略使用的神经网络模型

测试/部署 强化学习策略 的样例

新老 pipeline 的异同对比

Feature

Algorithm Versatility

(Click to Collapse)

discrete  discrete means discrete action space, which is only label in normal DRL algorithms (1-23)

continuous  means continuous action space, which is only label in normal DRL algorithms (1-23)

hybrid  means hybrid (discrete + continuous) action space (1-23)

dist  Distributed Reinforcement Learning|分布式强化学习

MARL  Multi-Agent Reinforcement Learning|多智能体强化学习

exp  Exploration Mechanisms in Reinforcement Learning|强化学习中的探索机制

IL  Imitation Learning|模仿学习

offline  Offiline Reinforcement Learning|离线强化学习

mbrl  Model-Based Reinforcement Learning|基于模型的强化学习

other  means other sub-direction algorithms, usually as plugin-in in the whole pipeline

P.S: The .py file in Runnable Demo can be found in dizoo

No. Algorithm Label Doc and Implementation Runnable Demo
1 DQN discrete DQN doc
DQN中文文档
policy/dqn
python3 -u cartpole_dqn_main.py / ding -m serial -c cartpole_dqn_config.py -s 0
2 C51 discrete C51 doc
policy/c51
ding -m serial -c cartpole_c51_config.py -s 0
3 QRDQN discrete QRDQN doc
policy/qrdqn
ding -m serial -c cartpole_qrdqn_config.py -s 0
4 IQN discrete IQN doc
policy/iqn
ding -m serial -c cartpole_iqn_config.py -s 0
5 FQF discrete FQF doc
policy/fqf
ding -m serial -c cartpole_fqf_config.py -s 0
6 Rainbow discrete Rainbow doc
policy/rainbow
ding -m serial -c cartpole_rainbow_config.py -s 0
7 SQL discretecontinuous SQL doc
policy/sql
ding -m serial -c cartpole_sql_config.py -s 0
8 R2D2 distdiscrete R2D2 doc
policy/r2d2
ding -m serial -c cartpole_r2d2_config.py -s 0
9 PG discrete PG doc
policy/pg
ding -m serial -c cartpole_pg_config.py -s 0
10 PromptPG discrete policy/prompt_pg ding -m serial_onpolicy -c tabmwp_pg_config.py -s 0
11 A2C discrete A2C doc
policy/a2c
ding -m serial -c cartpole_a2c_config.py -s 0
12 PPO/MAPPO discretecontinuousMARL PPO doc
policy/ppo
python3 -u cartpole_ppo_main.py / ding -m serial_onpolicy -c cartpole_ppo_config.py -s 0
13 PPG discrete PPG doc
policy/ppg
python3 -u cartpole_ppg_main.py
14 ACER discretecontinuous ACER doc
policy/acer
ding -m serial -c cartpole_acer_config.py -s 0
15 IMPALA distdiscrete IMPALA doc
policy/impala
ding -m serial -c cartpole_impala_config.py -s 0
16 DDPG/PADDPG continuoushybrid DDPG doc
policy/ddpg
ding -m serial -c pendulum_ddpg_config.py -s 0
17 TD3 continuoushybrid TD3 doc
policy/td3
python3 -u pendulum_td3_main.py / ding -m serial -c pendulum_td3_config.py -s 0
18 D4PG continuous D4PG doc
policy/d4pg
python3 -u pendulum_d4pg_config.py
19 SAC/[MASAC] discretecontinuousMARL SAC doc
policy/sac
ding -m serial -c pendulum_sac_config.py -s 0
20 PDQN hybrid policy/pdqn ding -m serial -c gym_hybrid_pdqn_config.py -s 0
21 MPDQN hybrid policy/pdqn ding -m serial -c gym_hybrid_mpdqn_config.py -s 0
22 HPPO hybrid policy/ppo ding -m serial_onpolicy -c gym_hybrid_hppo_config.py -s 0
23 BDQ hybrid policy/bdq python3 -u hopper_bdq_config.py
24 MDQN discrete policy/mdqn python3 -u asterix_mdqn_config.py
25 QMIX MARL QMIX doc
policy/qmix
ding -m serial -c smac_3s5z_qmix_config.py -s 0
26 COMA MARL COMA doc
policy/coma
ding -m serial -c smac_3s5z_coma_config.py -s 0
27 QTran MARL policy/qtran ding -m serial -c smac_3s5z_qtran_config.py -s 0
28 WQMIX MARL WQMIX doc
policy/wqmix
ding -m serial -c smac_3s5z_wqmix_config.py -s 0
29 CollaQ MARL CollaQ doc
policy/collaq
ding -m serial -c smac_3s5z_collaq_config.py -s 0
30 MADDPG MARL MADDPG doc
policy/ddpg
ding -m serial -c ptz_simple_spread_maddpg_config.py -s 0
31 GAIL IL GAIL doc
reward_model/gail
ding -m serial_gail -c cartpole_dqn_gail_config.py -s 0
32 SQIL IL SQIL doc
entry/sqil
ding -m serial_sqil -c cartpole_sqil_config.py -s 0
33 DQFD IL DQFD doc
policy/dqfd
ding -m serial_dqfd -c cartpole_dqfd_config.py -s 0
34 R2D3 IL R2D3 doc
R2D3中文文档
policy/r2d3
python3 -u pong_r2d3_r2d2expert_config.py
35 Guided Cost Learning IL Guided Cost Learning中文文档
reward_model/guided_cost
python3 lunarlander_gcl_config.py
36 TREX IL TREX doc
reward_model/trex
python3 mujoco_trex_main.py
37 Implicit Behavorial Cloning (DFO+MCMC) IL policy/ibc
model/template/ebm
python3 d4rl_ibc_main.py -s 0 -c pen_human_ibc_mcmc_config.py
38 BCO IL entry/bco python3 -u cartpole_bco_config.py
39 HER exp HER doc
reward_model/her
python3 -u bitflip_her_dqn.py
40 RND exp RND doc
reward_model/rnd
python3 -u cartpole_rnd_onppo_config.py
41 ICM exp ICM doc
ICM中文文档
reward_model/icm
python3 -u cartpole_ppo_icm_config.py
42 CQL offline CQL doc
policy/cql
python3 -u d4rl_cql_main.py
43 TD3BC offline TD3BC doc
policy/td3_bc
python3 -u d4rl_td3_bc_main.py
44 Decision Transformer offline policy/dt python3 -u d4rl_dt_mujoco.py
45 EDAC offline EDAC doc
policy/edac
python3 -u d4rl_edac_main.py
46 QGPO offline QGPO doc
policy/qgpo
python3 -u ding/example/qgpo.py
47 MBSAC(SAC+MVE+SVG) continuousmbrl policy/mbpolicy/mbsac python3 -u pendulum_mbsac_mbpo_config.py \ python3 -u pendulum_mbsac_ddppo_config.py
48 STEVESAC(SAC+STEVE+SVG) continuousmbrl policy/mbpolicy/mbsac python3 -u pendulum_stevesac_mbpo_config.py
49 MBPO mbrl MBPO doc
world_model/mbpo
python3 -u pendulum_sac_mbpo_config.py
50 DDPPO mbrl world_model/ddppo python3 -u pendulum_mbsac_ddppo_config.py
51 DreamerV3 mbrl world_model/dreamerv3 python3 -u cartpole_balance_dreamer_config.py
52 PER other worker/replay_buffer rainbow demo
53 GAE other rl_utils/gae ppo demo
54 ST-DIM other torch_utils/loss/contrastive_loss ding -m serial -c cartpole_dqn_stdim_config.py -s 0
55 PLR other PLR doc
data/level_replay/level_sampler
python3 -u bigfish_plr_config.py -s 0
56 PCGrad other torch_utils/optimizer_helper/PCGrad python3 -u multi_mnist_pcgrad_main.py -s 0
57 AWR discrete policy/ibc python3 -u tabmwp_awr_config.py

Environment Versatility

(Click to Collapse)
No Environment Label Visualization Code and Doc Links
1 Atari discrete original dizoo link
env tutorial
环境指南
2 box2d/bipedalwalker continuous original dizoo link
env tutorial
环境指南
3 box2d/lunarlander discrete original dizoo link
env tutorial
环境指南
4 classic_control/cartpole discrete original dizoo link
env tutorial
环境指南
5 classic_control/pendulum continuous original dizoo link
env tutorial
环境指南
6 competitive_rl discrete selfplay original dizoo link
环境指南
7 gfootball discretesparseselfplay original dizoo link
env tutorial
环境指南
8 minigrid discretesparse original dizoo link
env tutorial
环境指南
9 MuJoCo continuous original dizoo link
env tutorial
[环境指南](https://di-engine-docs.readthedocs.i

README 内容过长,已截取前 64 KB。完整内容请前往 GitHub 仓库查看。

评论

登录 后发表评论
暂无评论
GitRead 中文社区
深度解读 · 趋势洞察 · 价值精选

关于

关于我们联系我们编辑准则收录标准赞赏人员

发现

技术趋势新手训练营资源精选实战指南精选专题热门话题GitHub 文档

条款

隐私政策服务条款网站地图
26.9万收录项目
5.9万中文话题
155精选专题
发现技术价值,连接开源智慧
© 2026 GitRead · GitHub 中文社区 本站与 GitHub, Inc. 无隶属关系;GitHub 是 GitHub, Inc. 的商标。