Comments (4)
cfg
就是user config啊,在任何compile和merge的时候都是放在第二个参数上
from di-engine.
create_config才是usr_config的哇。。?
from di-engine.
理一下config的结构和compile_config
的原理:
- user_config:用户写的
env_algo_config.py
是user_config;user_config中有两部分,main_config和create_config,前者是具体的参数设置信息,后者是具体各个模块创建需要的信息(比如什么类型,相应文件的引用路径)。 - main_config(cfg):main_config是所有使用情况下都必需的config,包含所有具体的配置信息,所以在代码里也一般简写为cfg
- create_config:对于使用CLI工具,或者
serial_entry_xxx.py
系列入口,为了实现多算法通用的接口,使用注册器-创建函数机制来创建模块,因此就需要指定额外的信息(比如policy要指定type是dqn),并在compile_config函数中传入create_config,同时指定auto=True
;但是如果使用自定义入口(比如cartpole_dqn_main.py
),就可以直接import相关类来创建对象,同时直接将具体的类名传入compile_config函数并指定auto=False
- compile_config:DI-engine中的诸多模块都有
default_config
,一方面在阅读代码时可以看到这个类最常用的配置参数值,另一方面,用户在使用时就不需要指定所有相关的配置字段了,只需指定其想修改的相关字段。而compile_config,就是将user_config和default_config进行合并和转化的相关函数,而要在这个函数中获得default_config,就必须知道这次启动想要使用的模块对应的类,所以要么传create_config,要么传具体的类名 - 另外,关于config的高级转化和验证,我们还设计实现了
Loader
相关工具,在分布式版本中将会起到重要作用,有兴趣的话可以了解一下 https://github.com/opendilab/DI-engine/tree/main/ding/utils/loader
from di-engine.
好的 懂了 多谢~~
from di-engine.
Related Issues (20)
- how to separate training environments and evaluation environments HOT 1
- Flask version error import HOT 3
- How can I use the algorithm I designed (such as a new multi-agent reinforcement learning algorithm) in the relevant environment (such as MPE, SMAC, etc.) provided by this platform? HOT 2
- what algorithm do you use to sovle the overcooked problem? MADDPG? HOT 3
- 代码报错:在配置好conda环境以及将该项目fork到本地后,在运行DI-engine/dizoo/petting_zoo/config/路径下的所有py文件(如ptz_simple_spread_madqn_config.py;ptz_simple_spread_mappo_config.py等)时均出现报错 HOT 3
- H-PPO算法运行失败 HOT 7
- 尝试使用自定义环境出现问题 HOT 2
- gym soccer是否有文档? 其参数设置以及action的类型该如何写 HOT 3
- record a video HOT 2
- Implementation of Mean-Field MARL algorithm HOT 3
- FQF logit computation HOT 3
- 混合动作空间环境,PPO使用gae_estimator报错 HOT 3
- 如何获取每个episode的reward值 HOT 1
- TD3应用混合动作空间报错,AssertionError HOT 1
- how to get the ckpt file? HOT 2
- get "TypeError: __init__() got an unexpected keyword argument 'agent_obs_shape'" when running " python3 -u smac_5m6m_masac_config.py" HOT 2
- question for SMAC HOT 3
- docker内运行lunarlander_dqn_deploy失败 HOT 6
- cannot run GTrXL demo since v0.5.0 HOT 1
- BrokenPipeError: [WinError 232] 管道正在被关闭 has occurred, when running MARL algorithm QMIX in pettingzoo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from di-engine.