Stay up, even when pushed
Small-angle holding tests feedback and disturbance rejection. The goal allows twitching: every individual link must remain above horizontal.
A pendulum can be easy to hold and difficult to acquire. Separate the physical task, the information the network receives, and the search that learns its actions.
Small-angle holding tests feedback and disturbance rejection. The goal allows twitching: every individual link must remain above horizontal.
Swing-up must coordinate energy and phase while respecting the rail and acceleration limits. More successful holding does not by itself establish a successful swing-up.
Keep the policy fixed. Probe initial state, numerical resolution and actuation separately. Compare actual link motion with the fitness and the topology.
Six distinct saved double-pendulum networks were tested with larger acceleration limits, releases from rest and physical knockdowns. The best-looking high-acceleration NEAT swing-up did not survive finer physics steps. None of these changes established a reliable swing-up without rail contact.
Both rods start 140° from upright: 50° below horizontal, at rest. Each cell counts runs holding every link above horizontal for the final 15 seconds of a 90-second rollout. Twenty fresh starts per cell. These are observed holds, before rejecting large constraint errors; every successful large-angle run below contacted the rail.
| Frozen policy / acceleration | 120 Hz physics | 240 Hz | 480 Hz |
|---|---|---|---|
| Full NEAT · 2×34,000 → 68,000 px/s² | 20 / 20 | 2 / 20 | 0 / 20 |
| PPO momentum actor · 2×Initial momentum removed for this test | 17 / 20 | 11 / 20 | 13 / 20 |
| PPO 25° actor · original limitA different frozen actor; 34,000 px/s² | 17 / 20 | 18 / 20 | 15 / 20 |
The separate PPO 25° actor often finds a rail-contact catch at its original limit. That is an interesting experimental behavior, with failures still present; it does not establish that higher acceleration is the missing ingredient. The NEAT reversal shows strong timestep sensitivity, although these tests alone do not isolate which part of the contact dynamics causes it.
120 Hz is not universally easier. In the same audit, the momentum actor released at 140° with zero velocity and its original acceleration held 0/20 at 120 Hz, 0/20 at 240 Hz and 17/20 at 480 Hz, again with rail contact. A smaller timestep can help one frozen controller and defeat another. These observations describe the discrete simulator and policy together.
a = maxAccel × networkOutput. Doubling the bound doubles the same output’s drive. It changes feedback gain, not just spare capacity. Production velocity inputs also divide by an acceleration-dependent scale. Fixing that scale changes the outcome, but one promising CMA-ES local hold still fell from 19/20 to 0/20 under refinement.
The PPO momentum replay now enables tip impulses of 40 every 3–5 seconds after a two-second catch. Ten paired one-minute starts caught without rail contact with nudges either on or off. Matched larger knockdowns still escaped the actor’s reliable recovery region; random nudges did not reliably repair them. Toggle them off to isolate feedback.
Next experiment: keep observation units fixed, then train with a range of acceleration limits and recovery states. Measure when the actuator saturates, whether each push adds useful energy, and whether catch rate survives smaller timesteps. A failed frozen policy does not prove a state is physically unreachable. Energy and phase matter alongside actuation limits, as illustrated in MIT’s underactuated-control notes.
| Method | What is demonstrated | What remains separate |
|---|---|---|
| Model-based reference | Single, double and triple swing-up → holding with random nudges | Double/triple use declared rigid driven-pivot equations, distinct from PBD. |
| NEAT · learned continuation | Double recovery at g8.5 from 42±2°; hold with tip impulses40 | Uses a wider±600px track.140° release remains outside the verified envelope. |
| PPO · backpropagation | Cold-start single balance; double momentum-assisted catch from below horizontal | The showcased double starts with supplied angular velocity. Unassisted swing-up from rest remains unsolved. |
| CMA-ES · weight search | Full-gravity single holding; g8.5 double55° recovery and local nudges | The double uses a wider±600px track. |
Angles are measured from upright. The learned records keep their full scene and held-out results. Their playback uses only the neural policy. The three references compute controls from a model; no neural weights are implied.
On the same 40 fresh starts in the new 42° scene, the earlier NEAT policy passed 0/40 and its evolved continuation passed 40/40. Hidden nodes grew from10 to11; enabled connections changed from66 to51. The improvement is in the measured behavior, not simply a larger graph. The new policy also passed finer-step and independent nudge tests.
Trajectory optimization found full swing-up motions in the actual point-mass simulator at high gravity. Those first PBD plans failed when the physical timestep was refined while controller timing stayed fixed, so they remain experimental teachers. The rigid references passed this check after refinement of their trajectory design. This distinguishes an executable strategy from a numerically robust controller.
Each cell runs two opposite releases for 30 simulated seconds. Green means both keep every link above horizontal for the final 10 seconds, with no rail contact anywhere in the trial. This is a quick diagnostic, not a reliability estimate.
Ready. These experiments run locally using the production physics and network.
Columns are first-link angles from upright: 90° is horizontal; 140° is 50° below horizontal. Other links retain the scene’s linked initial pose. Actual magnitudes add a fixed 0.35° perturbation, shared by every row. This matrix tests releases from rest; the supplied-momentum case has its own experiment below.
A failed cell only tells us this particular policy failed this particular test.
Refinement preserves the controller’s sampling period and damping per second. The stronger-actuator row preserves the saved velocity-input normalization; it changes the plant, not the weights. Nudge tests add ±35 px/s to the tip at 10 and 20 seconds. No assistance, teleportation, automatic reset or training is used.
Both double-pendulum rods begin about 105.5° from upright, below horizontal, with inward angular rates of about 5 and 1 rad/s. The older frozen PPO holder catches them using cart acceleration alone at g 8.5 on the original ±260 px rail. The initial velocities are consistent with the rod constraints; every subsequent frame runs the physical simulation. This is momentum-assisted swing-up, not recovery from rest or an animated state correction.
| Frozen controller / same selected start family | 120 / 240 / 480 Hz physics | What it establishes |
|---|---|---|
| PPO holder | 40 / 40 / 40 passes out of 40 each | A second independent batch through the saved scene loader also passed 40/40 at every resolution. |
| Newer PPO 25° actor | 27 / 38 / 35 of 40 | A stronger upright-release benchmark does not imply a larger recovery region everywhere. |
| NEAT 42° / CMA-ES 55° actors | 0 / 0 / 0 no-contact passes | These actors were trained on wider rails. This selected-state comparison is not an optimizer ranking. |
| PPO, same pose without initial motion | 0 / 0 / 0 no-contact passes | The supplied initial energy is essential in this experiment. |
Each trial lasts 90 s, with all links continuously above horizontal for the final 30 s and no rail contact; control stays at 120 Hz. Starts vary both rod angles and rates, both mirror signs, and initial cart velocity. Passing this bounded family does not imply arbitrary disturbance recovery.
The ready controller strip shows measured simulation-time ranges. The PPO catch takes about 2.4 s, including a two-second confirmation within 60° of upright. Rigid-reference timings use their actual holding-phase test. A displayed catch allows motion; it is not a claim of motionless equilibrium. Manual pushes or edited parameters invalidate the undisturbed timing estimate.
A learned time estimator is practical with a sufficiently broad rollout dataset. It should predict a time distribution and the chance of never catching, keeping failed or unfinished runs as censored observations. For a small fixed catalog, measured ranges are easier to validate than another neural model. Neural time-to-event prediction
The older dodge CNN already sees the whole board. Its danger encoding, however, can alias bullets moving in different directions. The new controller supplies nine short physical forecasts and uses a CMA-ES-trained shared network to rank them. Forecasting is an explicit model; the 41 scoring parameters are learned. There is no fallback controller or knowledge of future bullets.
For each command, the forecast measures clearance over four time horizons, wall margin, centrality, velocity alignment and continuity with the previous command. It predicts currently visible bullets ballistically: b(t) = b(0) + vt. The learned score chooses a route; a high score is a preference, not a calibrated probability of survival.
| Approach | Supplied structure | What must be learned |
|---|---|---|
| Temporal CNN | A sequence of board images. | Motion features and the mapping from those features to action. |
| Current forecast scorer | Measured velocity, a physical motion model and candidate actions. | How to rank the resulting safety and motion features. |
The forecast makes looming collisions explicit before contact, reducing what this small network must discover. This works well for the current ballistic bullets, but a forecast can be wrong and nine constant commands do not cover every evasive maneuver. Newly spawned bullets are unknown until observed. A temporal CNN could learn a richer policy; it needs its own matched training experiment before claiming which method is better.
| Frozen controller | Hit-free 20 s trials | Registered hits / s in continuous trials |
|---|---|---|
| Stationary | 0 / 40 | 0.951 |
| Existing CNN / dense network | 0 / 40 each | 0.300 / 0.259 |
| Learned forecast scorer | 33 / 40 | 0.010 |
| Same scorer, bullet velocity hidden | 0 / 40 | 0.251 |
| Existing hand-designed planner | 40 / 40 | 0 |
Mixed attacks at spawn-rate setting 3 (emissions vary by pattern); forty fresh seeds, paired terminal and continuous tests. The current CNN and dense policies were replayed, not retrained with matched compute. These results compare available controllers, not an architecture's ultimate capacity. At twice the spawn rate, the scorer survived 12 of 20 fresh trials.
Limiting the new forecast to the nearest eight bullets still gives 33/40 at this density. The evidence therefore supports usable motion information; it does not demonstrate that the wider field caused the improvement. The Network tab shows actual candidate scores, forecast paths and past frames. Those history thumbnails are diagnostic only. A temporal CNN is a sensible next controlled comparison, but it has not been trained here.
The old signing model's first word averaged 126 px of pen error on fresh starts, even though it could trace later loops. Its refinement discarded that first loop and froze a saturated cart/joint backbone. A tighter tolerance circle could not repair that training contract by itself.
The new experiment begins with neutral commands, learns 13 sparse/shared tanh coefficients and scores the entire 40 s first word. The cart and telescope outputs are learned; the existing joint servo holds a neutral bend. The target curve and future-target cues are supplied. All pen motion comes from the physical simulation.
| Frozen method | First word mean error | Later words mean error | All loop means <20 px |
|---|---|---|---|
| Previous model | 126.4 px | 28.5 px | 0/40 |
| Fixed tolerance · seed 201 | 17.7 px | 8.8 px | 33/40 |
| Fixed tolerance · seed 202 | 14.1 px | 8.6 px | 35/40 |
| Shrinking tolerance · selected seed 201 | 12.4 px | 8.3 px | 40/40 |
| Shrinking tolerance · seed 202 | 14.1 px | 7.4 px | 34/40 |
Matched starts, initialization, architecture and budget: two paired seeds, 100 generations, population 24, two 40 s rollouts per candidate. Fixed tolerance is 30 px; shrinking uses 160 → 120 → 90 → 60 → 45 → 30 px. Selection used separate development poses before these 40 unseen starts. Every test includes three full words; no warm-up is discarded. Ordinary browser Train creates a fresh dense network; the saved sparse/shared search ran offline.
The diagnosis is trainability, not demonstrated impossibility. Both curricula fix most of the old acquisition failure. The circle adjusts reward precision; initialization, action parameterization and including acquisition in the objective mattered together. The first B still has an approach stroke, and a loop's mean error does not bound every point. This spring/servo scene is calibrated at 120 Hz: 240 Hz remains close, while 480 Hz degrades, so numerical convergence remains unresolved.
The two ridges alter launch and landing angles; a movable bumper transfers momentum; the low beam limits high arcs. Beam contact is legal and produces a passive rebound. After the first real club impulse, the club freezes. The network cannot steer the airborne ball.
Separating overlaps previously injected spurious velocity, and cached velocities could disagree with contact impulses. The challenge now applies impulses only to inward contacts and keeps the simulation's velocity representations consistent. A second issue was optimization: weights near ±15,000 saturated tanh units, leaving ordinary small mutations ineffective. Rescaling those weights into a trainable range and continuing CMA-ES produced the new frozen model on the same geometry and motor limits.
| Physics rate | New frozen network: sunk | Zero commands: sunk |
|---|---|---|
| 120 Hz | 200/200 | 0/40 |
| 240 Hz | 199/200 | 0/40 |
| 480 Hz | 197/200 | 0/40 |
| 960 Hz | 200/200 | 0/40 |
Commands remain 120 Hz. The same 200 reserved initial-angle/hole pairs test every rate. Club tilt is 3–7° left, hole center 240–280 px, width 100 px. These are center-based slot sinks, not a detailed cup/rim model. An attempt normally lasts 10 s, with up to 4 s extra while a struck ball is still moving quickly. The inherited cart uses a bounded target-velocity servo. Ball and hole state are inputs; obstacle geometry is a fixed training layout. Original golf and putt retain their exact earlier behavior.
Finite differences of the actual point-mass simulation give full local controllability rank near upright for both double and triple pendulums. The legacy observation maps, however, hide some instantaneous state directions. The angular mode exposes every link’s signed rate.
| Local measurement | Double | Triple |
|---|---|---|
| Upright controllability rank | 6 / 6 | 8 / 8 |
| Legacy observation rank · upright | 6 / 6 | 7 / 8 |
| Legacy observation rank · horizontal | 4 / 6 | 5 / 8 |
| Angular observation rank · both poses | 6 / 6 | 8 / 8 |
Measured at gravity 1000, direct acceleration, no helpers. Scaled constrained angular coordinates; central differences ε = 10⁻³, 10⁻⁴, 10⁻⁵; 0.05-second input intervals. The controllability rank is unchanged across those perturbation sizes. See the measurement data and method.
The same-plant, model-derived LQR diagnostic holds both signed 5° double starts and signed 5°/15° triple starts without rail contact in the tested 60-second trials. Some larger double starts eventually hold after hitting the rails; those are not clean recovery results. A capable local reference helps separate a solvable holding problem from the difficulty of discovering its controller.
In the recorded g 10 compact-ReLU comparison, doubling acceleration broke previously successful small-angle holds even with the input units preserved. Widening the rail also changed the default position normalization: preserving the old encoding restored the small-angle trajectories. The 140° cases still failed. These are concrete calibration and strategy effects; they do not establish an energy shortage or an impossible plant.
A random-start NEAT run reached 1,910 generations without finding a usable local triple holder in this bounded experiment. A neural student fitted to a same-plant LQR teacher provided a stable starting policy. Full NEAT then improved disturbance rejection through real weight and topology changes.
| Frozen policy | Repeated tip impulse | Fresh 60 s trials |
|---|---|---|
| LQR imitation · 16 ReLU units | 10 | 40 / 40 at each physics rate |
| Same student · harder nudges | 16 | 0 / 40 at nominal rate |
| Imitation → full NEAT · 17 ReLU units | 16 | 40 / 40 at each physics rate |
Gravity1000, direct acceleration40000, original ±260px rail, linked 1–4° releases, fresh randomized tip impulses every3–5 seconds. Each passing trial keeps all three links above horizontal throughout with no rail contact. Physics120/240/480Hz; controller120Hz. No LQR teacher is called at neural playback. Impulse20 remains outside the refined policy’s reliable envelope.
This demonstrates a useful policy class and a successful initialization strategy for local holding. It does not prove that curriculum alone would find it from scratch, or that the learned holder can swing up. The raw-search and teacher-guided runs used different schedules and physical settings, so their training times are not a controlled comparison of initialization alone.
| Family | Information used to update the policy | Inspect |
|---|---|---|
| NEAT | Whole-episode scores; mutations and crossover change weights and topology. | Species, structural changes, retained-angle failures. |
| CMA-ES | Whole-episode scores; covariance adapts search over a fixed network. | Search spread, score distribution, behavior diversity. |
| PPO | Sampled actions, advantages and value targets; backpropagation updates actor and critic. | Policy/value loss, gradient norm, KL, clipping and exploration entropy. |
| Differentiable control | Derivatives through a stated dynamics model or its local linearizations. | Model error, trajectory feedback and numerical convergence. |
PPO does not need derivatives through the simulator. It learns from its trajectories and differentiates the network objectives. Replay uses the deterministic actor; the critic and random exploration are training tools. The implementation checks analytical gradients against finite differences and exposes the measured update signals. PPO · original paper
Damping can help dissipate unwanted motion near a catch, but also removes energy during acquisition. The useful amount depends on the strategy. In this simulator, the damping control attenuates particle velocities; cart drag is a separate term. A fair ablation preserves damping per second when changing timestep.
Zero gravity is not a straightforward easier version of upright control. In our zero-command check, a static25° pose simply remained there: it already passed the above-horizontal criterion. A static140° pose remained below it. Neither result demonstrates an acquired balance strategy. Always compare against zero control before interpreting curriculum progress.
Force-driven examples do exist: DeepMind’s public cart-pole model uses a bounded force motor, and its two- and three-pole tasks start in swing-up configurations. Its ten-second default, observation, reward and plant differ from these90-second per-link tests. This portfolio’s evidence is the explicit interface, visible internals and reproducible limits; velocity control is not a universal explanation for other demonstrations. Actuator model · Task, initialization and reward
Open a hypothesis to see its signature and a discriminating experiment. Several limitations can coexist; a graph is evidence to investigate, not an automatic verdict.
Look for: different angular velocities producing the same inputs, or channels flattening at their limits. Near horizontal, horizontal bob speed is a poor substitute for angular speed.
Test: train matched policies with signed rates or a history window. A frozen old network cannot consume a new encoding without adaptation. More hidden nodes cannot let a memoryless policy resolve two indistinguishable instantaneous inputs that require different actions.
Look for: sustained saturated commands, loss of rail margin and repeated impacts. An energy deficit can explain failure to reach a height; sufficient energy does not guarantee the right phase or a catch.
Test: compare a model-based trajectory under the same constraints; relax one physical bound as a counterfactual. Improvement suggests a constraint matters. Failure of one optimizer does not prove the constrained motion is impossible.
Look for: the teacher action changing sharply where a student’s output stays smooth, or persistent imitation error on informative, held-out inputs despite successful fitting by a larger policy. Topology size alone is not a measure of competence.
Test: fit a complete-state teacher using the same observation and action interface. Compare action error and closed-loop hold for linear, ReLU and recurrent policies. Successful imitation with a failed evolutionary search implicates discovery or objective design before representational impossibility.
Look for: rising fitness without longer physical holds; an upright-looking cart-to-tip direction while a middle rod falls; wall contacts helping the score.
Test: log every individual rod, rail contacts and final continuous hold beside reward. Keep shaped reward for learning, but promote examples using independent physical criteria. The live Control tab measures the displayed rollout, not population-wide success.
Look for: consistent performance at one stage followed by near-zero success after a small change, or forgetting earlier stages. Gravity-only progression can teach holding without ever teaching energy pumping.
Test: evaluate each checkpoint on its own stage, earlier stages and the next stage. Advance when there is repeatable overlap; retain some earlier cases. Reverse-start curricula sample states near a known goal state and expand outward. They require valid physical starts and still do not guarantee crossing an infeasible or disconnected region.
Look for: sharp timestep sensitivity, large rod-length residuals, large frame-dependent changes, or high-frequency actions that exploit the integrator.
Test: double physics resolution while holding each command for its original duration and preserving damping per second. If the result disappears, do not promote it as robust control. Separate the simulator timestep, controller rate and observation quantization; they are different experiments.
For a known plant, nonlinear trajectory optimization with feedback is a strong next comparator. Direct collocation, constraint-aware iLQR/DDP or constrained MPC can search coordinated motions explicitly; rail and actuator limits must still be checked on actual rollouts. A time-varying feedback controller can stabilize a feasible trajectory; a neural student can then learn from it.
This batch tested that route on the requested140°/98° linked start. A memoryless tanh student reached action MSE0.000915 on teacher labels but passed0/6 autonomous catches. Teacher-initialized PPO then used4.92 million physical steps: above-horizontal occupancy rose to72.4%, yet0/6 development trials held for the final30 seconds. These are failed development tests, not a hidden swing-up achievement. The sustained NEAT investigation screened117 high-gravity and54 teacher-initialized final candidates without finding a140° catch. The selected candidate from each branch then passed0/40 fresh90-second target trials.
Next, test trajectory phase or short memory against the same observation-only student, and collect corrections on the states the student actually visits. First make the same-plant teacher reliable under numerical refinement. A better curriculum is useful only if neighboring stages share a recoverable region; merely slowing the angle ramp does not establish that bridge.
The hard-terrain controller must jump across a pit yet stay low under a spike ceiling. A changing course makes spatial information matter: the same frozen network faces new tile arrangements each trial.
All 416 parameters were learned with separable CMA-ES. This is a convolutional architecture trained without backpropagation. The inputs are simulator-provided occupancy, not camera pixels or a view of the whole course. The Perception circuit displays both sensor planes, every filter and pooled map, body channels, dense activations and output requests from the actual forward pass.
| Untouched hard courses · 12 s horizon | Completed |
|---|---|
| Frozen CNN + body state | 72 / 80 |
| Same network, both raster planes removed | 0 / 80 |
| Untrained initialization / zero commands | 0 / 80 each |
The eight failures comprise three falls, one hazard collision and four timeouts. The result establishes a working controller within this generator; it does not rank CNNs against every alternative. This platformer uses acceleration-limited drive, gravity and tile collisions. A jump request becomes an upward impulse only while grounded and outside cooldown. Network requests and the plant’s 30 Hz held commands are shown separately.
The restored spatial-dodge study flattens two 16 × 16 danger maps, four body scalars and eight nearest-bullet tuples into 548 input neurons. Three hidden neurons and 2,744 evolved links connect them to two acceleration outputs. Those screen-shaped grids are real neural inputs; no convolution runs in this graph.
On 40 fresh moderate-density 20 s trials, 4 survived. Continuous tests registered 0.120 hits/s, versus 0.358 untrained and 0.719 stationary. Hiding images changed the result to 0.140 hits/s; hiding nearest-bullet state raised it to 0.509. The explicit motion channels contribute much more strongly here. It remains a visible proof of concept, separate from the stronger model-assisted dodge scorer and outside the automatic demo rotation.
Every heatmap and bar comes from the live controller. Warm and blue indicate signed magnitudes; maps scale per plane and bars clip at one. The live panels repaint alongside the main viewport. Optional Smoothing gently eases display intensity and bar length; exact numbers, choices, gates and timestamped history stay immediate. The motion-aware scorer still makes decisions at 20 Hz and records history at 10 Hz. Glowing glass and drifting embers are decorative. Collapse the circuit to stop its sampling and drawing, or choose Concise spacing for a shorter network view. Hover near a topology node to bring its label above the wiring.