Skip to content

Robot reaching

A little within reach

Move a target and watch a tiny imitation policy guide a two-link arm. Compare an untrained network with a policy learned from synthetic demonstrations.

Run the experiment

Choose a checkpoint and compute backend. Inference stays on your device.

Ready when you are. Start experiment to load the model.No model runs until you start
The reaching roomLearned policy · 2 × 1-unit links
Two-link arm and movable targetThe shaded sector is the trained target workspace. Drag to move the target, or use the labeled target controls below. The arm moves only from network-predicted joint velocities.DRAG THE TARGETShaded area = trained workspace · trail = recent motion

What changed with practice?

256 unseen episodes · 160 steps each · fixed targets

Before · random weights

0.4% held-out success

1.736 units mean final error

After · behavior cloning

100.0% held-out success

0.009 units mean final error

These are saved Python test-set measurements, not a score for this live run. Switch Checkpoint to compare the same starting pose yourself. CPU and WebGPU use identical weights.

Learn the action, not the answer

An original analytic teacher generated 384 reaching trajectories plus random recovery states. tinygrad trained 4,738 parameters with Adam to predict two joint velocities from joint angles, goal, and tip error. The browser has no inverse-kinematics controller: every moving step comes from the network.

Training, metrics & source ↗

Small model, real checks

6 inputs → 64 → 64 → 2 outputs. Disjoint seeds separate demonstrations, validation, and held-out testing. Exported FP32 WGSL and JavaScript CPU inference are checked against Python outputs before motion starts. Everything runs locally; no camera, account, or inference server.

LeRobot actor inspiration ↗

A teaching toy, not a robot driver

This is dimensionless kinematics, not dynamics. No gravity, collisions, torque limits, or real-robot validation. The elbow-positive sector excludes singularities and angle wrapping. Moving targets can fail; held-out results cover fixed goals only. SwiftShader testing checks shader correctness, not physical-GPU speed.