Upload folder using huggingface_hub
Browse files- README.md +78 -0
- config.json +31 -0
- impala_encoder.pt +3 -0
README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- robotics
|
| 5 |
+
- reinforcement-learning
|
| 6 |
+
- mimicgen
|
| 7 |
+
- visual-encoder
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# IMPALA pixel encoder — MimicGen `threading_d0`
|
| 11 |
+
|
| 12 |
+
The visual encoder from a DICE-RL pixel-Q critic that reaches **90% success** on MimicGen
|
| 13 |
+
`threading_d0` (needle-through-tripod insertion), trained from 224x224 RGB with DrQ random-shift
|
| 14 |
+
augmentation.
|
| 15 |
+
|
| 16 |
+
## What this is
|
| 17 |
+
|
| 18 |
+
Two IMPALA conv towers, one per camera, whose outputs are concatenated with 9 proprio dims:
|
| 19 |
+
|
| 20 |
+
```
|
| 21 |
+
images uint8 [B, 2, 224, 224, 3] + proprio [B, 9]
|
| 22 |
+
-> per-camera ImpalaTower (channels 16/32/32, residual blocks, 3x stride-2 pools)
|
| 23 |
+
-> 32 x 28 x 28 feature map, flattened -> Linear -> LayerNorm -> 128
|
| 24 |
+
-> concat([tower0, tower1, proprio]) = 265
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
6.6M parameters. Proprio is `eef_pos(3) + eef_quat(4) + gripper_qpos(2)`, StateScaler-scaled.
|
| 28 |
+
|
| 29 |
+
## Loading
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
import torch
|
| 33 |
+
from online_rl_mimicgen.pixel import PixelEncoder # PIXEL_IMG=224 must be set
|
| 34 |
+
|
| 35 |
+
enc = PixelEncoder(out_dim=128)
|
| 36 |
+
enc.load_state_dict(torch.load("impala_encoder.pt", map_location="cpu"))
|
| 37 |
+
enc.eval()
|
| 38 |
+
|
| 39 |
+
feats = enc(images_uint8, proprio_scaled) # -> [B, 265]
|
| 40 |
+
visual_only = feats[:, :256] # drop the proprio block
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
`PIXEL_IMG` is read from the environment at import time and fixes the head's input width, so it
|
| 44 |
+
must be `224` before `online_rl_mimicgen.pixel` is imported. At the library default of 84 the
|
| 45 |
+
`Linear` shapes will not match these weights.
|
| 46 |
+
|
| 47 |
+
## What it encodes — measured, in millimetres
|
| 48 |
+
|
| 49 |
+
Held-out state read-off (200 episodes, 20% held out **by episode**, 2-layer MLP head), against the
|
| 50 |
+
same protocol applied to frozen mean-pooled DINOv2 features:
|
| 51 |
+
|
| 52 |
+
| target | this encoder | frozen DINOv2 (768) |
|
| 53 |
+
|---|---|---|
|
| 54 |
+
| `eef_pos` | 33.3 mm | **15.8 mm** |
|
| 55 |
+
| `obj_pos` (needle) | 30.2 mm | **17.3 mm** |
|
| 56 |
+
| `goal_pos` (tripod) | **46.4 mm** | 73.7 mm |
|
| 57 |
+
| offset (needle − tripod) | **47.9 mm** | 97.1 mm |
|
| 58 |
+
| ‖offset‖ (scalar distance) | **31.7 mm** | 79.8 mm |
|
| 59 |
+
|
| 60 |
+
The pattern is the useful part: this encoder is **worse at absolute positions and better at every
|
| 61 |
+
relative quantity**. Task training reallocates precision toward the needle-hole relationship that
|
| 62 |
+
TD learning needs, at the cost of world-coordinate localisation it does not — with a third of the
|
| 63 |
+
feature dimensions.
|
| 64 |
+
|
| 65 |
+
Note it resolves the offset to ~48 mm while solving a task whose tolerance is far tighter, so
|
| 66 |
+
millimetre-accurate geometry is evidently not required for 90% success.
|
| 67 |
+
|
| 68 |
+
## Provenance and caveats
|
| 69 |
+
|
| 70 |
+
- Run `thrpix2_q_s42`, 300k env steps, DICE-RL model-free pixel Q (`--pixel-obs`, no world model).
|
| 71 |
+
- Trajectory: 57% at 0k (BC prior) → 86% at 50k → 89% at 100k → **90% at 300k**.
|
| 72 |
+
- **Trained WITH DrQ augmentation** (`random_shift`, pad=4 → ±1.79% of a 224 frame). This matters:
|
| 73 |
+
otherwise-identical runs **without** augmentation reach only **63.4%** (n=5) — augmentation is
|
| 74 |
+
worth ~+28 points here, so these weights should not be read as "what an IMPALA encoder learns"
|
| 75 |
+
independent of that regulariser.
|
| 76 |
+
- A sibling seed reached 96%, but its checkpoint predates encoder saving and is unrecoverable;
|
| 77 |
+
this is the best encoder that actually exists on disk.
|
| 78 |
+
- Single task, single simulator, two fixed camera poses. No claim of transfer.
|
config.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architecture": "ImpalaTower x2 (one per camera) + concatenated proprio",
|
| 3 |
+
"task": "mimicgen threading_d0",
|
| 4 |
+
"image_size": 224,
|
| 5 |
+
"cameras": [
|
| 6 |
+
"agentview",
|
| 7 |
+
"eye_in_hand"
|
| 8 |
+
],
|
| 9 |
+
"out_dim_per_tower": 128,
|
| 10 |
+
"output_width": 265,
|
| 11 |
+
"proprio_dim": 9,
|
| 12 |
+
"proprio_note": "eef_pos(3) + eef_quat(4) + gripper_qpos(2), StateScaler-scaled",
|
| 13 |
+
"params": 6618496,
|
| 14 |
+
"env_steps": 300007,
|
| 15 |
+
"trained_with": "DICE-RL pixel Q critic (model-free), DrQ random shift pad=4",
|
| 16 |
+
"pixel_augment": true,
|
| 17 |
+
"drq_shift_pad": 4,
|
| 18 |
+
"success_rate": {
|
| 19 |
+
"0k": 57,
|
| 20 |
+
"50k": 86,
|
| 21 |
+
"100k": 89,
|
| 22 |
+
"300k": 90
|
| 23 |
+
},
|
| 24 |
+
"state_readoff_rms_mm": {
|
| 25 |
+
"eef_pos": 33.3,
|
| 26 |
+
"obj_pos_needle": 30.2,
|
| 27 |
+
"goal_pos_tripod": 46.4,
|
| 28 |
+
"offset_vector": 47.9,
|
| 29 |
+
"offset_scalar": 31.7
|
| 30 |
+
}
|
| 31 |
+
}
|
impala_encoder.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:405a7daaf09d64484bed5c3b641288cb69c3d8a17c62bd3f5dfdad72aa166cef
|
| 3 |
+
size 26498013
|