cagataydev commited on
Commit
1d94f28
·
verified ·
1 Parent(s): ee4d8b8

SAC Go2 walking policy - 1.74M steps, 21m forward distance

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ go2_walking.mp4 filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - reinforcement-learning
4
+ - robotics
5
+ - mujoco
6
+ - locomotion
7
+ - unitree
8
+ - go2
9
+ - quadruped
10
+ - sac
11
+ - stable-baselines3
12
+ - strands-robots
13
+ library_name: stable-baselines3
14
+ model-index:
15
+ - name: SAC-Unitree-Go2-MuJoCo
16
+ results:
17
+ - task:
18
+ type: reinforcement-learning
19
+ name: Quadruped Locomotion
20
+ dataset:
21
+ type: custom
22
+ name: MuJoCo LocomotionEnv
23
+ metrics:
24
+ - type: mean_reward
25
+ value: 4912
26
+ name: Best Mean Reward
27
+ - type: mean_distance
28
+ value: 21.0
29
+ name: Mean Forward Distance (m)
30
+ ---
31
+
32
+ # SAC Unitree Go2 — MuJoCo Locomotion Policy
33
+
34
+ A **Soft Actor-Critic (SAC)** policy trained to make the Unitree Go2 quadruped **walk forward** in MuJoCo simulation.
35
+
36
+ Trained entirely on a MacBook (CPU, no GPU, no Isaac Gym) using [strands-robots](https://github.com/cagataycali/strands-gtc-nvidia).
37
+
38
+ ## Results
39
+
40
+ | Metric | Value |
41
+ |--------|-------|
42
+ | Algorithm | SAC (Soft Actor-Critic) |
43
+ | Training steps | 1.74M |
44
+ | Training time | ~40 min (MacBook M-series, CPU) |
45
+ | Parallel envs | 8 |
46
+ | Network | MLP [256, 256] |
47
+ | Best reward | **4,912** |
48
+ | Mean distance | **21 meters** per episode |
49
+ | Forward velocity | ~1 m/s |
50
+ | Episode length | 1,000/1,000 (full episodes) |
51
+
52
+ ## Demo Video
53
+
54
+ See `go2_walking.mp4` — the Go2 executing the trained policy in MuJoCo.
55
+
56
+ ## Usage
57
+
58
+ ```python
59
+ from stable_baselines3 import SAC
60
+
61
+ model = SAC.load("best/best_model")
62
+
63
+ # In a MuJoCo Go2 environment:
64
+ obs, _ = env.reset()
65
+ for _ in range(1000):
66
+ action, _ = model.predict(obs, deterministic=True)
67
+ obs, reward, done, truncated, info = env.step(action)
68
+ ```
69
+
70
+ ## Reward Function
71
+
72
+ ```
73
+ reward = forward_vel × 5.0 # primary: move forward
74
+ + alive_bonus × 1.0 # stay upright
75
+ + upright_reward × 0.3 # orientation bonus
76
+ - ctrl_cost × 0.001 # minimize energy
77
+ - lateral_penalty × 0.3 # don't drift sideways
78
+ - smoothness × 0.0001 # discourage jerky motion
79
+ ```
80
+
81
+ ## Why SAC > PPO
82
+
83
+ PPO (500K steps): Go2 learned to stand still. Reward = 615, distance = 0.02m.
84
+ SAC (1.74M steps): Go2 walks 21 meters. Reward = 4,912.
85
+
86
+ SAC's off-policy learning + entropy regularization explores more effectively in continuous action spaces.
87
+
88
+ ## Files
89
+
90
+ - `best/best_model.zip` — Best checkpoint (highest eval reward)
91
+ - `checkpoints/` — All 100K-step checkpoints
92
+ - `logs/evaluations.npz` — Evaluation metrics over training
93
+ - `go2_walking.mp4` — Demo video
94
+
95
+ ## Environment
96
+
97
+ - **Simulator**: MuJoCo (via mujoco-python)
98
+ - **Robot**: Unitree Go2 (12 DOF) from MuJoCo Menagerie
99
+ - **Observation**: joint positions, velocities, torso orientation, height (37-dim)
100
+ - **Action**: joint torques (12-dim, continuous)
101
+
102
+ ## License
103
+
104
+ Apache-2.0
best/best_model.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1be75beaf0169882394e51b409514411622b4925458500fe3f613580bbbf316
3
+ size 3518124
checkpoints/sac_go2_1000000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b9e34811e96154ea9fc359084a8a229ce41f5499173337b069fbaeaab515fa21
3
+ size 3518124
checkpoints/sac_go2_100000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:089bd3806fab7303f7f47451cda1eb6b94551b86c248dd3ad331a6512a710d9c
3
+ size 3518121
checkpoints/sac_go2_1100000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa67b6823a90ce4ef15d0daa931e4ad5aba0ee55898cc44cae74c49c4007eaaa
3
+ size 3518124
checkpoints/sac_go2_1200000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2486b8cdc3cc85dd5d8a3c8f964761ffc85e2a2a822c7fb8da7b1ec309f3cb1e
3
+ size 3518124
checkpoints/sac_go2_1300000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc296a4819b8402a9a32f209e0ff90646ece9a51d0e3c57a26710b50e9b2ab00
3
+ size 3518124
checkpoints/sac_go2_1400000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cd04d348dccfc8bcf6e48a54265acba01da7849dcc03c606b4fa536a0ba6096
3
+ size 3518124
checkpoints/sac_go2_1500000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac25dffb29d95188e380e8ac0db7d36a4099b3096947a9323a0bebdaeef35fcf
3
+ size 3518124
checkpoints/sac_go2_1600000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d862ab7c45da950588b8c9c6807015f3cc56c0c3e12f7b8170d84f605e733b04
3
+ size 3518124
checkpoints/sac_go2_1700000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df99a844639417e7c960865286f4846b95aa3aae7b10b858a63e30852e56fc7b
3
+ size 3518124
checkpoints/sac_go2_200000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f32315804e25be4c0f43ac746e496cac383c91abec766fd49835dcef9e500538
3
+ size 3518121
checkpoints/sac_go2_300000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6498240d98962c000e043b6cf5351110247263ff7c3ddeb2b87be0ad80d7db4c
3
+ size 3518122
checkpoints/sac_go2_400000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ca61bd3752cb95e0926bb70e3575031c382f4d0a74dd51e0d668d0259e5c7b3
3
+ size 3518122
checkpoints/sac_go2_500000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9c4a43c721cb3487fd2f4ce5250f426f683fea43109f03895c59dc33da1d6fc
3
+ size 3518122
checkpoints/sac_go2_600000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7019796c129420228764ea85522534caacded8c70c87e856e70387cce0309ec
3
+ size 3518131
checkpoints/sac_go2_700000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:752eb6fc89aa892e797337e13f6d1ec861a014523f9573e4e5c6566b34ec4c71
3
+ size 3518122
checkpoints/sac_go2_800000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:afefe902f24986e5a34544b0933be81ffd946c230f6d1a914c42f6d18255c000
3
+ size 3518122
checkpoints/sac_go2_900000_steps.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb0a32f7547fbeaceda54e51b673d0ee278cf0ce06467f320eb2f4a23b497227
3
+ size 3518123
go2_walking.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:deeb18b0caf206543ecb0e9cec44633526143a5cf1bd744fad520ab65fcf759b
3
+ size 1119500
logs/evaluations.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c13ff82c7c7544bdfe544741052312a234e2b0a410a10199dd4a56dd29699573
3
+ size 16082