buffaX commited on
Commit
9bca105
·
verified ·
1 Parent(s): 423992c

Add README

Browse files
Files changed (1) hide show
  1. README.md +22 -15
README.md CHANGED
@@ -1,29 +1,36 @@
1
  # SAC Ant Agent
2
 
3
- A PPO agent trained on the MuJoCo Ant-v4 environment.
4
 
5
  ## Training Details
6
  - Algorithm: SAC
7
- - Timesteps: 2e6
8
- - Reward: ...
 
 
 
 
 
 
 
 
9
 
10
  ## Usage
11
 
12
- ```bash
13
- pip install huggingface_hub huggingface_sb3
14
-
15
  # login to huggingFace
16
- huggingface-cli login
17
- ```
18
-
19
 
20
- ```python
21
  from stable_baselines3 import SAC
22
- from huggingface_hub import hf_hub_download
23
 
24
- model_file = hf_hub_download(
25
- repo_id="your-username/ppo-ant-demo",
26
- filename="model.zip"
27
  )
28
- model = SAC.load(model_file)
 
 
 
29
  ```
 
1
  # SAC Ant Agent
2
 
3
+ A SAC agent trained on the MuJoCo Ant-v4 environment.
4
 
5
  ## Training Details
6
  - Algorithm: SAC
7
+ - Timesteps: 2.4e6
8
+ ```
9
+ - learning_rate=3e-4,
10
+ - buffer_size=1_000_000, # 经验回放缓冲区大小. 这个参数PPO没有
11
+ - batch_size=256, # 默认256
12
+ - tau=0.005, # 软更新系数
13
+ - gamma=0.99, # 折扣因子
14
+ - train_freq=1, # 每步都训练,采集多少个环境步的数据后训练一次
15
+ - gradient_steps=1, # 对replayBuffer中读取到的batch,进行多少次梯度下降更新
16
+ ```
17
 
18
  ## Usage
19
 
20
+ ```python
21
+ !pip install huggingface_sb3
 
22
  # login to huggingFace
23
+ !huggingface-cli login
 
 
24
 
 
25
  from stable_baselines3 import SAC
26
+ from huggingface_sb3 import load_from_hub
27
 
28
+ model_path = load_from_hub( # This function only returns the path of the cached model
29
+ repo_id="buffaX/sac-ant-v4",
30
+ filename="sac_ant.zip"
31
  )
32
+
33
+ model = SAC.load(model_path)
34
+ print(model.actor)
35
+ print(model.critic)
36
  ```