Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -21,7 +21,7 @@ model-index:
|
|
21 |
type: OpenAI/Gym/Box2d-LunarLander-v2
|
22 |
metrics:
|
23 |
- type: mean_reward
|
24 |
-
value:
|
25 |
name: mean_reward
|
26 |
---
|
27 |
|
@@ -67,10 +67,10 @@ import torch
|
|
67 |
|
68 |
# Pull model from files which are git cloned from huggingface
|
69 |
policy_state_dict = torch.load("pytorch_model.bin", map_location=torch.device("cpu"))
|
70 |
-
cfg = EasyDict(Config.file_to_dict("policy_config.py"))
|
71 |
# Instantiate the agent
|
72 |
agent = DDPGAgent(
|
73 |
-
|
74 |
exp_name="LunarLander-v2-DDPG",
|
75 |
cfg=cfg.exp_config,
|
76 |
policy_state_dict=policy_state_dict
|
@@ -101,7 +101,7 @@ from huggingface_ding import pull_model_from_hub
|
|
101 |
policy_state_dict, cfg = pull_model_from_hub(repo_id="OpenDILabCommunity/LunarLander-v2-DDPG")
|
102 |
# Instantiate the agent
|
103 |
agent = DDPGAgent(
|
104 |
-
|
105 |
exp_name="LunarLander-v2-DDPG",
|
106 |
cfg=cfg.exp_config,
|
107 |
policy_state_dict=policy_state_dict
|
@@ -131,7 +131,7 @@ from ding.bonus import DDPGAgent
|
|
131 |
from huggingface_ding import push_model_to_hub
|
132 |
|
133 |
# Instantiate the agent
|
134 |
-
agent = DDPGAgent("
|
135 |
# Train the agent
|
136 |
return_ = agent.train(step=int(4000000), collector_env_num=4, evaluator_env_num=4)
|
137 |
# Push model to huggingface hub
|
@@ -148,7 +148,8 @@ push_model_to_hub(
|
|
148 |
usage_file_by_git_clone="./ddpg/lunarlander_ddpg_deploy.py",
|
149 |
usage_file_by_huggingface_ding="./ddpg/lunarlander_ddpg_download.py",
|
150 |
train_file="./ddpg/lunarlander_ddpg.py",
|
151 |
-
repo_id="OpenDILabCommunity/LunarLander-v2-DDPG"
|
|
|
152 |
)
|
153 |
|
154 |
```
|
@@ -172,11 +173,11 @@ exp_config = {
|
|
172 |
'retry_waiting_time': 0.1,
|
173 |
'cfg_type': 'BaseEnvManagerDict'
|
174 |
},
|
175 |
-
'stop_value':
|
|
|
176 |
'env_id': 'LunarLanderContinuous-v2',
|
177 |
'collector_env_num': 8,
|
178 |
'evaluator_env_num': 8,
|
179 |
-
'n_evaluator_episode': 8,
|
180 |
'act_scale': True
|
181 |
},
|
182 |
'policy': {
|
@@ -231,9 +232,10 @@ exp_config = {
|
|
231 |
'render_freq': -1,
|
232 |
'mode': 'train_iter'
|
233 |
},
|
|
|
234 |
'cfg_type': 'InteractionSerialEvaluatorDict',
|
235 |
-
'
|
236 |
-
'
|
237 |
}
|
238 |
},
|
239 |
'other': {
|
@@ -281,14 +283,14 @@ exp_config = {
|
|
281 |
- **Configuration:** [config link](https://huggingface.co/OpenDILabCommunity/LunarLander-v2-DDPG/blob/main/policy_config.py)
|
282 |
- **Demo:** [video](https://huggingface.co/OpenDILabCommunity/LunarLander-v2-DDPG/blob/main/replay.mp4)
|
283 |
<!-- Provide the size information for the model. -->
|
284 |
-
- **Parameters total size:**
|
285 |
-
- **Last Update Date:** 2023-
|
286 |
|
287 |
## Environments
|
288 |
<!-- Address questions around what environment the model is intended to be trained and deployed at, including the necessary information needed to be provided for future users. -->
|
289 |
- **Benchmark:** OpenAI/Gym/Box2d
|
290 |
- **Task:** LunarLander-v2
|
291 |
- **Gym version:** 0.25.1
|
292 |
-
- **DI-engine version:** v0.4.
|
293 |
-
- **PyTorch version:**
|
294 |
- **Doc**: [DI-engine-docs Environments link](https://di-engine-docs.readthedocs.io/en/latest/13_envs/lunarlander.html)
|
|
|
21 |
type: OpenAI/Gym/Box2d-LunarLander-v2
|
22 |
metrics:
|
23 |
- type: mean_reward
|
24 |
+
value: 264.9 +/- 18.41
|
25 |
name: mean_reward
|
26 |
---
|
27 |
|
|
|
67 |
|
68 |
# Pull model from files which are git cloned from huggingface
|
69 |
policy_state_dict = torch.load("pytorch_model.bin", map_location=torch.device("cpu"))
|
70 |
+
cfg = EasyDict(Config.file_to_dict("policy_config.py").cfg_dict)
|
71 |
# Instantiate the agent
|
72 |
agent = DDPGAgent(
|
73 |
+
env_id="LunarLanderContinuous-v2",
|
74 |
exp_name="LunarLander-v2-DDPG",
|
75 |
cfg=cfg.exp_config,
|
76 |
policy_state_dict=policy_state_dict
|
|
|
101 |
policy_state_dict, cfg = pull_model_from_hub(repo_id="OpenDILabCommunity/LunarLander-v2-DDPG")
|
102 |
# Instantiate the agent
|
103 |
agent = DDPGAgent(
|
104 |
+
env_id="LunarLanderContinuous-v2",
|
105 |
exp_name="LunarLander-v2-DDPG",
|
106 |
cfg=cfg.exp_config,
|
107 |
policy_state_dict=policy_state_dict
|
|
|
131 |
from huggingface_ding import push_model_to_hub
|
132 |
|
133 |
# Instantiate the agent
|
134 |
+
agent = DDPGAgent(env_id="LunarLanderContinuous-v2", exp_name="LunarLander-v2-DDPG")
|
135 |
# Train the agent
|
136 |
return_ = agent.train(step=int(4000000), collector_env_num=4, evaluator_env_num=4)
|
137 |
# Push model to huggingface hub
|
|
|
148 |
usage_file_by_git_clone="./ddpg/lunarlander_ddpg_deploy.py",
|
149 |
usage_file_by_huggingface_ding="./ddpg/lunarlander_ddpg_download.py",
|
150 |
train_file="./ddpg/lunarlander_ddpg.py",
|
151 |
+
repo_id="OpenDILabCommunity/LunarLander-v2-DDPG",
|
152 |
+
create_repo=False
|
153 |
)
|
154 |
|
155 |
```
|
|
|
173 |
'retry_waiting_time': 0.1,
|
174 |
'cfg_type': 'BaseEnvManagerDict'
|
175 |
},
|
176 |
+
'stop_value': 260,
|
177 |
+
'n_evaluator_episode': 8,
|
178 |
'env_id': 'LunarLanderContinuous-v2',
|
179 |
'collector_env_num': 8,
|
180 |
'evaluator_env_num': 8,
|
|
|
181 |
'act_scale': True
|
182 |
},
|
183 |
'policy': {
|
|
|
232 |
'render_freq': -1,
|
233 |
'mode': 'train_iter'
|
234 |
},
|
235 |
+
'figure_path': None,
|
236 |
'cfg_type': 'InteractionSerialEvaluatorDict',
|
237 |
+
'stop_value': 260,
|
238 |
+
'n_episode': 8
|
239 |
}
|
240 |
},
|
241 |
'other': {
|
|
|
283 |
- **Configuration:** [config link](https://huggingface.co/OpenDILabCommunity/LunarLander-v2-DDPG/blob/main/policy_config.py)
|
284 |
- **Demo:** [video](https://huggingface.co/OpenDILabCommunity/LunarLander-v2-DDPG/blob/main/replay.mp4)
|
285 |
<!-- Provide the size information for the model. -->
|
286 |
+
- **Parameters total size:** 115.03 KB
|
287 |
+
- **Last Update Date:** 2023-09-22
|
288 |
|
289 |
## Environments
|
290 |
<!-- Address questions around what environment the model is intended to be trained and deployed at, including the necessary information needed to be provided for future users. -->
|
291 |
- **Benchmark:** OpenAI/Gym/Box2d
|
292 |
- **Task:** LunarLander-v2
|
293 |
- **Gym version:** 0.25.1
|
294 |
+
- **DI-engine version:** v0.4.9
|
295 |
+
- **PyTorch version:** 2.0.1+cu117
|
296 |
- **Doc**: [DI-engine-docs Environments link](https://di-engine-docs.readthedocs.io/en/latest/13_envs/lunarlander.html)
|