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 = SACAgent(
|
| 73 |
-
|
| 74 |
)
|
| 75 |
# Continue training
|
| 76 |
agent.train(step=5000)
|
|
@@ -98,7 +98,7 @@ from huggingface_ding import pull_model_from_hub
|
|
| 98 |
policy_state_dict, cfg = pull_model_from_hub(repo_id="OpenDILabCommunity/LunarLander-v2-SAC")
|
| 99 |
# Instantiate the agent
|
| 100 |
agent = SACAgent(
|
| 101 |
-
|
| 102 |
exp_name="LunarLander-v2-SAC",
|
| 103 |
cfg=cfg.exp_config,
|
| 104 |
policy_state_dict=policy_state_dict
|
|
@@ -128,7 +128,7 @@ from ding.bonus import SACAgent
|
|
| 128 |
from huggingface_ding import push_model_to_hub
|
| 129 |
|
| 130 |
# Instantiate the agent
|
| 131 |
-
agent = SACAgent("
|
| 132 |
# Train the agent
|
| 133 |
return_ = agent.train(step=int(4000000), collector_env_num=8, evaluator_env_num=8)
|
| 134 |
# Push model to huggingface hub
|
|
@@ -145,7 +145,8 @@ push_model_to_hub(
|
|
| 145 |
usage_file_by_git_clone="./sac/lunarlander_sac_deploy.py",
|
| 146 |
usage_file_by_huggingface_ding="./sac/lunarlander_sac_download.py",
|
| 147 |
train_file="./sac/lunarlander_sac.py",
|
| 148 |
-
repo_id="OpenDILabCommunity/LunarLander-v2-SAC"
|
|
|
|
| 149 |
)
|
| 150 |
|
| 151 |
```
|
|
@@ -169,12 +170,12 @@ exp_config = {
|
|
| 169 |
'retry_waiting_time': 0.1,
|
| 170 |
'cfg_type': 'BaseEnvManagerDict'
|
| 171 |
},
|
| 172 |
-
'stop_value':
|
|
|
|
| 173 |
'env_id': 'LunarLanderContinuous-v2',
|
| 174 |
'collector_env_num': 4,
|
| 175 |
'evaluator_env_num': 8,
|
| 176 |
-
'act_scale': True
|
| 177 |
-
'n_evaluator_episode': 8
|
| 178 |
},
|
| 179 |
'policy': {
|
| 180 |
'model': {
|
|
@@ -225,9 +226,10 @@ exp_config = {
|
|
| 225 |
'render_freq': -1,
|
| 226 |
'mode': 'train_iter'
|
| 227 |
},
|
|
|
|
| 228 |
'cfg_type': 'InteractionSerialEvaluatorDict',
|
| 229 |
-
'
|
| 230 |
-
'
|
| 231 |
}
|
| 232 |
},
|
| 233 |
'other': {
|
|
@@ -273,14 +275,14 @@ exp_config = {
|
|
| 273 |
- **Configuration:** [config link](https://huggingface.co/OpenDILabCommunity/LunarLander-v2-SAC/blob/main/policy_config.py)
|
| 274 |
- **Demo:** [video](https://huggingface.co/OpenDILabCommunity/LunarLander-v2-SAC/blob/main/replay.mp4)
|
| 275 |
<!-- Provide the size information for the model. -->
|
| 276 |
-
- **Parameters total size:**
|
| 277 |
-
- **Last Update Date:** 2023-
|
| 278 |
|
| 279 |
## Environments
|
| 280 |
<!-- 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. -->
|
| 281 |
- **Benchmark:** OpenAI/Gym/Box2d
|
| 282 |
- **Task:** LunarLander-v2
|
| 283 |
- **Gym version:** 0.25.1
|
| 284 |
-
- **DI-engine version:** v0.4.
|
| 285 |
-
- **PyTorch version:**
|
| 286 |
- **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: 277.21 +/- 17.51
|
| 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 = SACAgent(
|
| 73 |
+
env_id="LunarLanderContinuous-v2", exp_name="lunarlander-sac", cfg=cfg.exp_config, policy_state_dict=policy_state_dict
|
| 74 |
)
|
| 75 |
# Continue training
|
| 76 |
agent.train(step=5000)
|
|
|
|
| 98 |
policy_state_dict, cfg = pull_model_from_hub(repo_id="OpenDILabCommunity/LunarLander-v2-SAC")
|
| 99 |
# Instantiate the agent
|
| 100 |
agent = SACAgent(
|
| 101 |
+
env_id="LunarLanderContinuous-v2",
|
| 102 |
exp_name="LunarLander-v2-SAC",
|
| 103 |
cfg=cfg.exp_config,
|
| 104 |
policy_state_dict=policy_state_dict
|
|
|
|
| 128 |
from huggingface_ding import push_model_to_hub
|
| 129 |
|
| 130 |
# Instantiate the agent
|
| 131 |
+
agent = SACAgent(env_id="LunarLanderContinuous-v2", exp_name="LunarLander-v2-SAC")
|
| 132 |
# Train the agent
|
| 133 |
return_ = agent.train(step=int(4000000), collector_env_num=8, evaluator_env_num=8)
|
| 134 |
# Push model to huggingface hub
|
|
|
|
| 145 |
usage_file_by_git_clone="./sac/lunarlander_sac_deploy.py",
|
| 146 |
usage_file_by_huggingface_ding="./sac/lunarlander_sac_download.py",
|
| 147 |
train_file="./sac/lunarlander_sac.py",
|
| 148 |
+
repo_id="OpenDILabCommunity/LunarLander-v2-SAC",
|
| 149 |
+
create_repo=False
|
| 150 |
)
|
| 151 |
|
| 152 |
```
|
|
|
|
| 170 |
'retry_waiting_time': 0.1,
|
| 171 |
'cfg_type': 'BaseEnvManagerDict'
|
| 172 |
},
|
| 173 |
+
'stop_value': 260,
|
| 174 |
+
'n_evaluator_episode': 8,
|
| 175 |
'env_id': 'LunarLanderContinuous-v2',
|
| 176 |
'collector_env_num': 4,
|
| 177 |
'evaluator_env_num': 8,
|
| 178 |
+
'act_scale': True
|
|
|
|
| 179 |
},
|
| 180 |
'policy': {
|
| 181 |
'model': {
|
|
|
|
| 226 |
'render_freq': -1,
|
| 227 |
'mode': 'train_iter'
|
| 228 |
},
|
| 229 |
+
'figure_path': None,
|
| 230 |
'cfg_type': 'InteractionSerialEvaluatorDict',
|
| 231 |
+
'stop_value': 260,
|
| 232 |
+
'n_episode': 8
|
| 233 |
}
|
| 234 |
},
|
| 235 |
'other': {
|
|
|
|
| 275 |
- **Configuration:** [config link](https://huggingface.co/OpenDILabCommunity/LunarLander-v2-SAC/blob/main/policy_config.py)
|
| 276 |
- **Demo:** [video](https://huggingface.co/OpenDILabCommunity/LunarLander-v2-SAC/blob/main/replay.mp4)
|
| 277 |
<!-- Provide the size information for the model. -->
|
| 278 |
+
- **Parameters total size:** 116.05 KB
|
| 279 |
+
- **Last Update Date:** 2023-09-23
|
| 280 |
|
| 281 |
## Environments
|
| 282 |
<!-- 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. -->
|
| 283 |
- **Benchmark:** OpenAI/Gym/Box2d
|
| 284 |
- **Task:** LunarLander-v2
|
| 285 |
- **Gym version:** 0.25.1
|
| 286 |
+
- **DI-engine version:** v0.4.9
|
| 287 |
+
- **PyTorch version:** 2.0.1+cu117
|
| 288 |
- **Doc**: [DI-engine-docs Environments link](https://di-engine-docs.readthedocs.io/en/latest/13_envs/lunarlander.html)
|