Robotics
LeRobot
Safetensors
diffusion-policy
manipulation
ur7e
File size: 22,068 Bytes
ae647b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
---
license: apache-2.0
library_name: lerobot
tags:
  - robotics
  - diffusion-policy
  - lerobot
  - manipulation
  - ur7e
pipeline_tag: robotics
datasets:
  - Bigenlight/banana_in_pot_lerobot_v3
---

# Diffusion Policy β€” Put the right banana in the pot (UR7e, END-EFFECTOR action space)

A **Diffusion Policy** (visuomotor DDPM, 1D-conv UNet denoiser) trained by imitation
learning to perform the manipulation task *"put the right banana in the pot"* on a
**Universal Robots UR7e** arm with two RGB cameras. Actions are **10-D absolute
end-effector (EE) targets**: `action = [x, y, z (meters), r1..r6 (6-D rotation), grip]`.
The observation state is likewise **10-D** in the same EE parameterization.

- **Policy:** LeRobot `DiffusionPolicy` β€” per-camera **ResNet18** visual encoder
  (ImageNet-pretrained) + **SpatialSoftmax** keypoints, conditioning a **1D convolutional
  UNet** denoiser. Receding-horizon action generation: `horizon = 64`, `n_obs_steps = 2`,
  `n_action_steps = 32`.
- **Noise model:** **DDPM**, `num_train_timesteps = 100`, `beta_schedule =
  squaredcos_cap_v2`, `prediction_type = epsilon` (Ξ΅-prediction), `clip_sample = true`.
- **Trained on:** [`Bigenlight/banana_in_pot_lerobot_v3`](https://huggingface.co/datasets/Bigenlight/banana_in_pot_lerobot_v3)
  β€” 51 teleoperated episodes / 21,524 frames, UR7e follower + GELLO leader, 2 RGB cameras
  (EE-pose action/state variant of the task).
- **This checkpoint:** step **100,000** β€” the best of the 80k–100k plateau: 100k has the
  **best gripper accuracy (0.966)** and the **best overall L1**, and its `poseMAE` is tied
  within noise with the 80k minimum (see [Results](#results--the-headline-finding)).
- **Framework:** [LeRobot](https://github.com/huggingface/lerobot) v0.6.1.

> **Headline finding (read this first):** on a held-out split the diffusion **denoising
> `eval_loss` ROSE ~4.5Γ— (0.0250 @8k β†’ 0.112 @100k)**, and LeRobot's auto-report flags this
> as "overfit from ~8k". That verdict is **misleading**. The deployment-relevant **open-loop
> rollout MAE kept IMPROVING then plateaued** (poseMAE 0.0665 β†’ ~0.0368; gripAcc β†’ 0.966) β€”
> **no destructive overfit through 100k.** **For a Diffusion Policy the held-out denoising
> loss is a misleading overfit/early-stop signal β€” select checkpoints by open-loop MAE, not
> by `eval_loss`.** (Exactly the lesson from the [JOINT sibling](https://huggingface.co/Bigenlight/diffusion_banana_in_pot_joint).)

---

## Task & data

**"put the right banana in the pot."** The tabletop holds several distractor objects β€”
**two bananas, an apple, carrots/peppers, and a slice of watermelon** β€” plus a **silver
pot**. The operator must grasp the **RIGHT banana** (the target) and place it inside the
pot. Success = the right banana ends up inside the pot. Every demonstration is a success.

- **Dataset:** [`Bigenlight/banana_in_pot_lerobot_v3`](https://huggingface.co/datasets/Bigenlight/banana_in_pot_lerobot_v3)
  (LeRobot v3.0 format).
- **Scale:** **51 episodes / 21,524 frames / 30 fps / ~12 min.**
- **Action / state space:** 10-D absolute end-effector pose,
  `[x, y, z (meters), r1..r6 (6-D rotation, unitless), grip]`. The gripper channel is
  effectively binary (open/close). This is the **EE** variant; the sibling model uses a
  7-D joint action instead.
- **Cameras:** two RGB viewpoints (Intel RealSense D435 + D435if), captured at 1280Γ—720
  (720p) @ 30 fps, **RGB only** (no depth / IR). `cam1 ↔ cam2` order is fixed and must be
  preserved at deploy time.

### Train / held-out split

Training holds out the **LAST 6 episodes (indices 45–50)** as a true validation split and
trains on the other **45** episodes (0–44). The held-out episodes 45–50 are used both for
the in-training denoising `eval_loss` probe and for all offline open-loop evaluation below.

---

## Model architecture

LeRobot `DiffusionPolicy`. All values below are quoted directly from the checkpoint's
`config.json`. The architecture is **identical to the JOINT sibling** except that the first
(state) and last (action) layers are 10-D instead of 7-D.

**Observation encoder (vision):**

| Item | Value |
|---|---|
| Vision backbone | `resnet18` |
| Pretrained weights | `ResNet18_Weights.IMAGENET1K_V1` (ImageNet) |
| Per-camera encoder | `use_separate_rgb_encoder_per_camera = true` (separate ResNet18 per view) |
| Pooling | **SpatialSoftmax**, `spatial_softmax_num_keypoints = 32` |
| Group norm in encoder | `use_group_norm = false` (keeps BatchNorm from the pretrained backbone) |
| Cameras | 2 Γ— RGB (`observation.images.cam1`, `observation.images.cam2`) |
| Network input resolution | **360 Γ— 640** (`resize_shape = [360, 640]`; see [why](#why-the-two-non-default-flags-are-required)) |
| Crop | **OFF** β€” `crop_shape = null`, `crop_ratio = 1.0` (`crop_is_random` is moot with no crop) |
| State input | `observation.state`, shape `(10,)` |

> Note: `config.json` records the raw dataset image feature shape as `[3, 720, 1280]`, but
> the on-the-fly `Resize` to `[360, 640]` (`resize_shape`) means the network actually sees
> **360 Γ— 640** frames. See the training section for why this must match at inference.

**Denoiser (conditional 1D-conv UNet):**

| Item | Value |
|---|---|
| Denoiser | 1D convolutional UNet (Diffusion Policy / Janner-style) |
| `down_dims` | `[512, 1024, 2048]` |
| `kernel_size` | `5` |
| `n_groups` (GroupNorm) | `8` |
| `diffusion_step_embed_dim` | `128` |
| FiLM conditioning | `use_film_scale_modulation = true` |
| `horizon` | `64` (prediction horizon, in frames) |
| `n_obs_steps` | `2` (observation context length) |
| `n_action_steps` | `32` (actions executed before replanning) |

> **Conditioning dimension (EE-specific):** each observation contributes
> `state 10 + vision 128 = 138-D` (per-camera ResNet18 β†’ 64-D, two cameras β†’ 128-D); with
> `n_obs_steps = 2` the UNet `global_cond` is **276-D** (the JOINT model's is 270-D). This
> 6-D difference is the only structural change from the JOINT config.

**Diffusion process (noise scheduler):**

| Item | Value |
|---|---|
| `noise_scheduler_type` | `DDPM` |
| `num_train_timesteps` | `100` |
| `beta_schedule` | `squaredcos_cap_v2` (cosine) |
| `beta_start` / `beta_end` | `0.0001` / `0.02` |
| `prediction_type` | `epsilon` (predict noise) |
| `clip_sample` | `true`, `clip_sample_range = 1.0` |
| `num_inference_steps` | `null` in config β†’ defaults to the full DDPM schedule at inference unless overridden (evals here used **DDIM, 10 steps** for speed β€” see [Usage](#usage--inference)) |

**Normalization (`normalization_mapping`):**

| Feature group | Mode |
|---|---|
| `VISUAL` (images) | `MEAN_STD` (ImageNet stats, `use_imagenet_stats = true`) |
| `STATE` (observation.state) | `MIN_MAX` |
| `ACTION` (action) | `MIN_MAX` |

Normalizer statistics are baked into the pre/post-processor pipelines saved alongside the
checkpoint (`policy_preprocessor.json` / `policy_postprocessor.json`), not into
`forward()`.

**I/O summary:**

| I/O | Spec |
|---|---|
| `observation.state` | `(10,)` β€” `[x, y, z (m), r1..r6 (6-D rotation), grip]` |
| `observation.images.cam1` / `cam2` | RGB, network input **360 Γ— 640** |
| `action` | `(10,)` β€” `[x, y, z (m), r1..r6 (6-D rotation), grip]`, **absolute** EE pose + ~binary gripper |

**Size:** ~**277.9M** parameters, fp32 ~**1.11 GB** β€” effectively identical to the JOINT
model (they differ only by the 3-D width of the first and last layers).

---

## Training setup

Trained with `lerobot-train` (LeRobot 0.6.1). Values below are from the saved training
config; hyperparameters match the JOINT run.

| Item | Value |
|---|---|
| Policy | `diffusion` (`--policy.type=diffusion`) |
| Dataset | `banana_in_pot_lerobot_v3` (EE action/state), holds out eps 45–50 |
| Batch size | **8** |
| Steps | **100,000**; checkpoints saved every 10,000 |
| Optimizer | **Adam**, `lr = 1e-4`, `betas = [0.95, 0.999]`, `eps = 1e-8`, `weight_decay = 1e-6` |
| LR scheduler | **cosine** (`scheduler_name = cosine`), `num_warmup_steps = 500` |
| Precision | **fp32** (`use_amp = false`) |
| EMA | **none** (no EMA weights in this config) |
| Image transform | on-the-fly `Resize` to `[360, 640]`, deterministic |
| `drop_n_last_frames` | **31** (non-default; see below) |
| `resize_shape` | `[360, 640]` (non-default; see below) |
| Control rate | dataset 30 fps, consecutive frames (step = 1) β€” no downsampling. obs 2 frames (~0.067 s) / horizon 64 (2.13 s) / exec 32 (1.07 s) @ 30 Hz |
| Eval probe | held-out denoising `eval_loss`; open-loop rollouts run offline per checkpoint |

### Why the two non-default flags are required

Both `resize_shape=[360,640]` and `drop_n_last_frames=31` are **not** the LeRobot defaults;
they are mandatory for this dataset/config and encode real operational knowledge:

1. **`resize_shape=[360,640]` β€” SpatialSoftmax is shape-rigid.** The Diffusion Policy RGB
   encoder ends in a `SpatialSoftmax` layer whose keypoint geometry is fixed to the spatial
   dimensions of the feature map at build time. The network must therefore be *constructed*
   for the exact input resolution it will ever see. Setting `resize_shape=[360,640]` builds
   the encoder for 360Γ—640 and β€” combined with crop being **off** (`crop_shape=null`) β€”
   guarantees the training image path, the offline-eval image path, and any deploy image
   path all feed the encoder identically. A mismatched resolution (or leaving crop on)
   changes the SpatialSoftmax grid and breaks the model.

2. **`drop_n_last_frames=31` β€” horizon / n_action off-by-one at episode ends.** The
   trajectory sampler must not draw a window that runs past the end of an episode. With
   `horizon=64`, `n_obs_steps=2`, and `n_action_steps=32`, the correct number of trailing
   frames to drop is `horizon - n_action_steps - (n_obs_steps - 1) = 64 - 32 - 1 = 31`.
   Using the default (7, tuned for the reference `horizon=16` config) would let the sampler
   pull frames off the end of an episode and corrupt the action targets. **If you change
   `horizon`/`n_obs_steps`/`n_action_steps`, recompute `drop_n_last_frames`.**

---

## Results & the headline finding

![Diffusion EE: held-out denoising eval_loss (rising, misleading) vs open-loop rollout MAE (improving then plateauing through 100k)](assets/diffusion_ee_overfit_diag.png)

Offline **open-loop** evaluation on the held-out episodes **45–50** with `eval_offline.py`
(each logged observation is fed to `select_action`; the predicted action is compared to the
dataset ground truth). Sampling used **DDIM with 10 inference steps**
(`--scheduler DDIM --num-inference-steps 10`) for ~10Γ— faster rollouts; DDIM is a valid
sampler for a DDPM-trained Ξ΅ model (same beta schedule). `poseMAE` is the mean absolute
error over the first 9 pose dims; `gripAcc` is the binary gripper-open/close accuracy
(threshold 0.5); `overall L1` averages all 10 dims. Numbers persisted at
[`assets/diffusion_ee_openloop_eval.csv`](assets/diffusion_ee_openloop_eval.csv).

| checkpoint | poseMAE (own scale ↓) | gripAcc ↑ | overall L1 ↓ |
|---|---|---|---|
| 10k | 0.06648 | 0.886 | 0.07517 |
| 20k | 0.04499 | 0.923 | 0.05031 |
| 30k | 0.04345 | 0.930 | 0.04839 |
| 40k | 0.03999 | 0.926 | 0.04440 |
| 50k | 0.03786 | 0.942 | 0.04126 |
| 60k | 0.03900 | 0.950 | 0.04131 |
| 70k | 0.03687 | 0.956 | 0.03846 |
| 80k | **0.03674** ⟡ poseMAE min | 0.961 | 0.03773 |
| 90k | 0.03718 | 0.955 | 0.03856 |
| **100k** ⭐ | 0.03717 | **0.966** ⟡ max | **0.03754** ⟡ min |

> **Units caveat β€” do NOT compare `poseMAE` across the two models.** The EE `poseMAE`
> mixes **meters** (x, y, z) with **6-D rotation** (unitless) channels, so it is on a
> completely different scale from the JOINT model's **radian** `poseMAE` (0.0845). The two
> numbers are not comparable β€” judge the EE model **only** by its own trend.

**Best checkpoint = the 80k–100k plateau.** `poseMAE` falls 0.0665 β†’ ~0.0368 and then
flattens from ~70k (70k/80k/90k/100k all within Β±0.0004 = eval noise); its strict minimum is
**0.03674 @ 80k**. `gripAcc` rises essentially monotonically to **0.966 @ 100k**;
`overall L1` is lowest at **100k (0.03754)**. There is **no open-loop overfitting through
100k**. We upload **100k** because it gives the best gripper and best overall L1 while its
`poseMAE` is tied within noise with the 80k minimum β€” deploy 100k is safe and strictly
best-gripper. (Pick 80k if you want the strict `poseMAE` minimum; both sit on the plateau.)

### The misleading `eval_loss` (the lesson)

During training the held-out **denoising `eval_loss`** (LeRobot's in-training validation
probe, computed under `policy.eval()` on eps 45–50) did the *opposite* of the rollout
metric:

| step | held-out eval_loss |
|---|---|
| 2k | 0.0331 |
| **8k** | **0.0250** (min) |
| 100k | 0.112 (~4.5Γ— above the min) |

Read naively, the held-out `eval_loss` bottoms at **step 8k** and then rises ~4.5Γ—, and
LeRobot's auto-report calls it **"overfit from ~8k"**. **That verdict is wrong for
deployment:** the same held-out episodes, evaluated by open-loop rollout, get
*monotonically better* out to the 70k–100k plateau.

**Why the two signals disagree:** a diffusion policy is trained to predict the noise added
at a **random** timestep, and `eval_loss` scores exactly that random-timestep
noise-prediction on held-out frames β€” so it is (a) high-variance/stochastic by construction
and (b) only loosely coupled to closed-loop action quality. But what drives the robot is the
**sampled action** β€” the *integral* of the full reverse-diffusion trajectory (here DDIM-10).
Those two quantities decorrelate: the network can get "worse" at random-timestep denoising
MSE while the *sampled* action trajectory keeps getting **closer** to ground truth. **The
only faithful held-out metric is to actually sample actions and compare them open-loop**,
which is what `eval_offline.py` does. **Takeaway: for a Diffusion Policy, select checkpoints
and early-stop by open-loop rollout MAE, not by held-out denoising `eval_loss`.** (The ACT
sibling did not show this divergence β€” there the two signals agreed β€” so this is a
diffusion-specific pitfall, reconfirmed here on the EE action space.)

---

## Deployment note β€” research artifact, NOT wired to the robot

**Read this before trying to run the model on hardware.** Unlike the JOINT sibling β€” whose
7-D joint actions are **directly actuatable** and which is deployed on the real UR7e via the
[`Bigenlight/gello_software`](https://github.com/Bigenlight/gello_software) ROS 2 stack β€”
this EE model outputs **10-D end-effector poses** (`[x, y, z, r1..r6, grip]`). Those poses
must be converted to joint commands by **inverse kinematics (IK)** before they can drive the
arm.

**There is no IK deploy path in the current stack.** Accordingly this checkpoint is uploaded
as a **research artifact / reference for the EE action space**, **NOT** wired for
real-robot inference. It was **never run on the arm** and there are **no closed-loop
task-success results** for it.

For the actuatable path, use:

- the **JOINT model** [`Bigenlight/diffusion_banana_in_pot_joint`](https://huggingface.co/Bigenlight/diffusion_banana_in_pot_joint)
  (7-D joint actions, directly commandable), and
- the **diffusion deploy node** in
  [`Bigenlight/gello_software`](https://github.com/Bigenlight/gello_software) (ROS 2 Humble,
  UR7e follower, dual RealSense) used to run the JOINT policy.

To deploy *this* EE model you would additionally have to add an IK stage (EE pose β†’ joint
targets, with reachability/limit handling) after `select_action` β€” that work is out of scope
for this release.

---

## Usage / inference

The snippet below loads the policy and produces a 10-D EE action. **Note:** that action is
an end-effector pose β€” it needs **IK** before it can drive a robot (see the deployment note
above).

### Load the policy (LeRobot 0.6.1)

Normalization is **not** baked into `forward()` in LeRobot 0.6.1 β€” it lives in the
pre/post-processor pipelines saved with the checkpoint. `select_action` returns a
**normalized** action; the post-processor converts it back to the EE units.

```python
import torch
from lerobot.configs import PreTrainedConfig
from lerobot.policies.factory import get_policy_class, make_pre_post_processors

CKPT = "Bigenlight/diffusion_banana_in_pot_ee"
device = "cuda"

# (optional) speed up sampling: DDIM with 10 steps instead of the full DDPM schedule.
# Mutate the config BEFORE from_pretrained so the sampler is built with these settings.
cfg = PreTrainedConfig.from_pretrained(CKPT)
cfg.pretrained_path = CKPT
cfg.device = device
cfg.noise_scheduler_type = "DDIM"     # valid sampler for a DDPM-trained epsilon model
cfg.num_inference_steps = 10          # ~10x faster rollouts

policy = get_policy_class(cfg.type).from_pretrained(CKPT, config=cfg)  # -> DiffusionPolicy
policy.to(device)
policy.eval()

preprocessor, postprocessor = make_pre_post_processors(
    policy_cfg=cfg,
    pretrained_path=CKPT,
    preprocessor_overrides={"device_processor": {"device": device}},
)
```

### Produce actions

Build the observation dict exactly as training did: EE state `(10,)` plus **both** cameras
as RGB CHW tensors in `[0, 1]`, **resized to 360Γ—640** (aspect-preserving half-resolution).
`cam1`/`cam2` must map to the same physical viewpoints as at collection.

```python
policy.reset()          # once at the start of each episode/rollout
preprocessor.reset()
postprocessor.reset()

# obs = {
#   "observation.state":        state_10,         # (10,) float32: [x,y,z, r1..r6, grip]
#   "observation.images.cam1":  img1_chw,         # (3, 360, 640) float32 in [0,1]
#   "observation.images.cam2":  img2_chw,         # (3, 360, 640) float32 in [0,1]
#   "task": "put the right banana in the pot",
# }

with torch.inference_mode():
    proc   = preprocessor(obs)             # rename -> add batch dim -> device -> normalize
    action = policy.select_action(proc)    # (1, 10) NORMALIZED
    action = postprocessor(action)         # (1, 10) EE units, on cpu
ee_target = action.squeeze(0).numpy()      # (10,) -> [x, y, z, r1..r6, grip]
# NOTE: ee_target is an END-EFFECTOR POSE. To drive a robot you must first run IK
#       (ee_target[:9] -> joint targets); no IK deploy path ships with this model.
```

`select_action` returns **one** action per call from an internal queue. Because
`n_action_steps = 32`, the policy denoises a fresh action sequence, executes 32 actions
from it, then replans (with `n_obs_steps = 2` frames of observation context). Call
`policy.reset()` at the start of every episode to clear that queue. The gripper channel
`grip` is ~binary β€” threshold at `> 0.5 β†’ close`.

### Reproduce the offline evaluation

The repo's `eval_offline.py` runs the exact open-loop protocol used for the results table
(same 360Γ—640 `Resize`, same normalization via the saved processors):

```bash
python eval_offline.py \
  --checkpoint outputs/train/diffusion_ee_val_diag/checkpoints/100000/pretrained_model \
  --episodes 45,46,47,48,49,50 \
  --device cuda \
  --scheduler DDIM --num-inference-steps 10 \
  --out eval_out_diffusion_ee_100k
```

`--scheduler DDIM --num-inference-steps 10` gives the ~10Γ— rollout speedup; omit them to
sample with the full trained DDPM schedule (`num_train_timesteps = 100`).

---

## Limitations & intended use

- **Research artifact only β€” not deployable as-is.** The 10-D EE action requires IK to
  actuate and there is **no IK deploy path** in the stack, so this model was **never run on
  hardware** and has **no closed-loop success rate**. For a directly actuatable, deployed
  policy use the [JOINT sibling](https://huggingface.co/Bigenlight/diffusion_banana_in_pot_joint).
- **Small, single-task lab dataset:** 51 demonstrations, one scene layout, one operator.
  Expect limited generalization to novel object arrangements, lighting, or camera placement.
- **Success-only demonstrations:** no failure/recovery data; not suited as-is for methods
  that need negative examples.
- **Offline metrics only:** the best checkpoint (100k) reaches **held-out poseMAE β‰ˆ 0.0372**
  (EE's own mixed-unit scale) and gripper accuracy β‰ˆ 0.966 in open-loop rollout. These are
  *not* closed-loop task success rates, and the EE `poseMAE` is **not comparable** to the
  JOINT model's radian `poseMAE`.
- **Absolute EE action space:** the policy was only ever conditioned on states near the
  data-collection start pose; any real deployment would additionally need reachability /
  joint-limit handling in the IK stage plus the safety guards used for the JOINT model.
- **Not for production.** Intended for research in imitation learning / diffusion policies
  for robot manipulation. Workspace-, robot-, and camera-specific.
- The ResNet18 encoders are **ImageNet-pretrained** (not robotics-pretrained); the UNet
  denoiser is trained from scratch on this task.

---

## Links

- **Dataset:** [`Bigenlight/banana_in_pot_lerobot_v3`](https://huggingface.co/datasets/Bigenlight/banana_in_pot_lerobot_v3)
- **JOINT sibling model (deployed, actuatable):** [`Bigenlight/diffusion_banana_in_pot_joint`](https://huggingface.co/Bigenlight/diffusion_banana_in_pot_joint)
- **Experiments repo:** [github.com/Bigenlight/banana-in-pot-experiments](https://github.com/Bigenlight/banana-in-pot-experiments)
- **Deployment stack (ROS 2 Humble, JOINT path):** [github.com/Bigenlight/gello_software](https://github.com/Bigenlight/gello_software)
- **Framework:** [LeRobot](https://github.com/huggingface/lerobot) v0.6.1

## Citation

```bibtex
@misc{theo2026bananainpotdiffusionee,
  title        = {Diffusion Policy for "put the right banana in the pot"
                  (UR7e, end-effector action space)},
  author       = {Theo and {Bigenlight}},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/Bigenlight/diffusion_banana_in_pot_ee}},
  note         = {LeRobot 0.6.1 DiffusionPolicy, 10-D EE action, trained on
                  banana_in_pot_lerobot_v3; research artifact (needs IK to actuate)}
}
```

License: **Apache-2.0**.