MODULE 1 · LESSON 5 OF 6 · 30 MIN

The policy and the learner

The network inside the policy, the noise that makes it explore, and PPO as a black box that runs thousands of robots at once.

So far the policy has been a box that turns 78 numbers into 23. This lesson opens the box just enough to see what training changes, then treats the learner as what it will be until Module 3: a black box that makes the policy better.

SIMULATOR

Asimov 1 simulated with MuJoCo and driven by a trained policy, on your own computer.

Upright · 0.00 s

Inside the policy

The policy network as the simulator runs it. Inputs and outputs are coloured by this step’s values; select a layer for its size.

Angular velocity × 0.25 (rad/s)

Gravity direction

Command

Joint angles, relative to the default pose (rad)

Joint speeds × 0.1 (rad/s)

Previous actions

Left leg

Right leg

Waist

Right arm

Left arm

Select a layer to see what it computes.

Colour shows each value: blue below 0, red above, full colour at ±1 and beyond.

What is inside the policy?

A neural network, and not a large one. In cyclotron it is a stack of four layers: 78 inputs, then 512, 256 and 128 numbers, then 23 outputs. The built-in policy has exactly the same shape. Between layers sits a simple bend, the ELU function, which is what lets the network represent more than straight lines.

Each layer multiplies its inputs by a table of numbers, the weights, and adds a few more, the biases. Training changes nothing else. Learning to stand means finding the right values for these numbers.

Angular velocity × 0.25 (rad/s)

Gravity direction

Command

Joint angles, relative to the default pose (rad)

Joint speeds × 0.1 (rad/s)

Previous actions

Left leg

Right leg

Waist

Right arm

Left arm

Select a layer to see what it computes.

Colour shows each value: blue below 0, red above, full colour at ±1 and beyond. The simulator’s Inside the policy panel shows each step’s values.

The policy network. Inputs are grouped as lesson 2 lists them, outputs by body part; in the hidden layers each small square stands for 8 numbers. Select a layer to see what it computes. In the simulator's Inside the policy panel the inputs and outputs light up with each step's values.

Once the simulator is running, open Inside the policy: the input cells change colour as Asimov moves, and the output cells show the 23 actions it chose from them. Push the robot and watch both sides react within a step.

Exercise 5.1 · On paper

How big is the policy?

A layer from n inputs to k outputs has n×k weights and k biases. How many weights and biases does the policy have in total, from 78 inputs through 512, 256 and 128 to 23 outputs?

Hint 1
Four layers: 78 to 512, 512 to 256, 256 to 128, and 128 to 23.
Checkpoint: answers only
207,639.
Solution
  • 78 × 512 + 512 = 40,448
  • 512 × 256 + 256 = 131,328
  • 256 × 128 + 128 = 32,896
  • 128 × 23 + 23 = 2,967

Total 207,639. Small by today’s standards: small enough that this browser page runs it 50 times a second on your computer’s processor, alongside the physics.

How does a policy try new things?

If the policy always chose exactly the same action in the same situation, training would never find out whether something else works better. So during training the policy does not use its output directly. It treats the output as the centre of a bell curve and draws the action at random around it:

at∼N(μθ(ot),σ2)
SymbolMeaningUnitAsimov’s left knee, standing still (measured)
atthe action actually used at step t, drawn at random23 numbersleft knee: 0.63 in the example below
μθ(ot)the centre: the network’s output for observation ot23 numbersleft knee: −0.166
θall the network’s weights and biases, what training changes207,639 numbersthe built-in policy’s, fixed
σthe spread, the size of the noise. Most draws land within σ of the centre–1.0 when training starts; 0 on the robot
a=μ+σ z
=−0.166+1.0×0.80=0.63
q∗=0.45+0.25×0.63=0.61 rad

One example draw for the left knee, as training would make it at the start, with σ=1; z=0.80 is one sample of the standard bell curve. The network asked for a knee target of 0.409 rad; training tries 0.61 rad instead.

In cyclotron σ starts at 1.0 and is learned along with the weights; in the Build page’s full standing run it fell from 0.99 to 0.16 over 1,500 iterations, as the policy grew sure of what works. On the robot, and in this simulator, the noise is off: σ=0 and the policy uses its output directly.

The figure draws actions for one joint, the left knee, and shows the target each one asks for. With σ=1, a draw is often a whole unit away from the network’s output: a knee target 0.25 rad, about 14°, away from what the network chose.

0.40
1.00
How likely each action isμ, the network’s output−3−0.30−2−0.05−10.2000.4510.7020.9531.20action a (what the network’s output becomes after the noise)left knee target q* = 0.45 + 0.25 a (rad)
  • bell curve around μ, width σ
  • drawn actions
  • the last one

No actions drawn yet. Each draw is one training step’s action for the left knee.

The policy’s output μ is the centre; training draws the action a around it, with spread σ (blue curve). Each draw is a dot; the last one is orange. The lower scale shows the target angle each action asks of the left knee. With σ = 0 every draw is μ: the policy as it runs on the robot.

The Exploration noise panel adds that noise back to the built-in walking policy. Turn on End episodes like training does in the Episode panel, then raise the noise.

Exercise 5.2 · In the simulator

How much noise can a trained policy take?

Raise the noise in steps of 0.2 and give the robot 10 s at each level. At which level does it start to fall?

Hint 1
The noise is random, so try each level more than once.
Checkpoint: answers only
In the measured run, the robot first fell at a noise of 0.6, and fell in every trial from 0.8. Your result can differ: the noise is random.
Solution

The measured runs, two trials of 10 s per level:

Noise σFalls
0.20 of 2
0.40 of 2
0.61 of 2
0.82 of 2
1.02 of 2

A noise of 1.0 is where training starts, and a new policy’s output is far from useful as well. In the Build page’s full standing run, after 100 iterations, episodes still lasted 0.9 s on average. Every fall ends an episode early, and training learns from the difference between the attempts that lasted and the ones that did not.

The learner, as a black box

The learner in this course is PPO, Proximal Policy Optimization, the algorithm cyclotron uses. Module 3 opens it. For now, this is what it does, once per iteration:

  1. Collect. Run the policy, with noise, on 4,096 simulated robots at once, for 24 steps each.
  2. Score. Work out, from the rewards, which actions turned out better than the policy expected.
  3. Update. Change the weights a small step towards those actions.
  4. Repeat.

The robots are all in one simulation on one GPU, each in its own patch of floor, and each restarts on its own when its episode ends. One iteration collects 4,096 × 24 = 98,304 steps. At 0.02 s per step that is about 33 minutes of robot experience, gathered in a few seconds.

Exercise 5.3 · On paper

How much experience is a training run?

cyclotron’s walking task trains for 10,000 iterations of 98,304 steps. How much robot time is that? On an RTX 4060 Laptop GPU, one iteration of that task took 5.13 s. How long does the run take, and how much faster than real time is it?

Hint 1
One step is 0.02 s of robot time.
Checkpoint: answers only
About 228 days of robot time in about 14.3 hours: roughly 380 times faster than real time.
Solution
  • One iteration: 98,304 × 0.02 s = 1,966 s, about 32.8 min of robot time.
  • 10,000 iterations: 19,660,800 s, about 228 days.
  • Wall-clock time: 10,000 × 5.13 s = 51,300 s, about 14.3 h.
  • 1,966 s ÷ 5.13 s ≈ 383 times faster than real time.

This is why simulation is the place to train. Running the same experience on one real robot would take most of a year, with the robot falling over thousands of times.

Watching training happen

The Build page trains a standing policy for 1,500 iterations and saves it every 50. The Training scrubber loads five of those checkpoints into the simulator, from iteration 0 to the last, 1,499. Open it and pick one: Asimov restarts from the default pose with that policy. Then push it with Push in the corner of the 3D view.

This is what each checkpoint did in the measured runs: 20 s from the default pose, then pushes backward at the pelvis, from 50 N up in steps of 25 N.

Iteration20 s from the default poseBackward push that topples it
0stands125 N
100falls after 3.9 s–
200stands100 N
500stands125 N
1,499stands150 N

Three things stand out.

  • Iteration 0 stands. Its weights are random, but its output is small and steady: it keeps the joints within about 0.02 rad of the default pose. Lesson 3 showed that holding the default pose already stands.
  • Iteration 100 falls, after 3.9 s. Training has started changing the actions, but not yet in a useful way. Learning can make a policy worse before it makes it better.
  • From iteration 200 on, it stands, and what improves is how well: the joints settle closer to the default pose (on average 0.023 rad away at iteration 200, 0.010 rad at 1,499), and the push it takes grows from 75 N to 125 N.

Notice that iteration 0, which only holds its pose, already takes 100 N. Nothing in this task ever pushes the robot, so training had little reason to get much better at it. Module 2 trains with pushes.

Optional The critic, briefly

PPO trains a second network alongside the policy, the critic. It never runs on the robot. Its job during training is to predict how much reward the policy will collect from a given situation, so step 2 above can tell an action that was lucky from one that was good. Because it only runs in simulation, it may see what the robot cannot: in cyclotron’s walking task it reads 93 values, including the pelvis’s real speed and whether each foot touches the ground. Module 3 explains how it learns and how PPO uses it.

Recap

  • The policy is a neural network of four layers and 207,639 weights and biases; training only changes those numbers.
  • During training, actions are drawn from a bell curve around the network’s output; the noise starts at 1.0 and shrinks as the policy improves.
  • PPO collects experience from 4,096 robots for 24 steps, finds which actions did better than expected, nudges the policy, and repeats.
  • One iteration is about 33 minutes of robot experience; a 10,000-iteration run is about 228 days.

Sources

  1. cyclotron, PPO runner: network 512-256-128 with ELU, initial noise 1.0, 24 steps per robot per iteration, 10,000 iterationssource/cyclotron/cyclotron/tasks/locomotion/agents/rsl_rl_ppo_cfg.py, lines 59–93 (commit d71390f)
  2. cyclotron, velocity task: 4,096 robotssource/cyclotron/cyclotron/tasks/locomotion/velocity_env_cfg.py, the scene configuration (num_envs=4096)
  3. Training speed: 5.13 s per iteration for the velocity task with 4,096 robots on an NVIDIA GeForce RTX 4060 Laptop GPUcyclotron logs/rsl_rl/asimov1_velocity/2026-11-02_16-15-50_smoke_walking_ft_4096, TensorBoard wall time
  4. The Build page's full standing run: noise σ from 0.99 to 0.16 (Policy/mean_std); mean episode length 43 steps at iteration 100 (Train/mean_episode_length)cyclotron course/module-1 (commit d71390f), run asimov1_stand_ideal/2026-11-17_14-06-27_ppo, TensorBoard; site/src/content/learn/en/module-1/training-curves.json
  5. The built-in policy has the same shape: 78 → 512 → 256 → 128 → 23, with ELU between layerssite/learn-sim/policies/menlo-reference/policy.onnx, graph: Gemm, Elu, Gemm, Elu, Gemm, Elu, Gemm
  6. The left knee's default angle (0.45 rad) and action scale (0.25) in the built-in policysite/learn-sim/policies/menlo-reference/env.yaml, scene.robot.init_state.joint_pos and actions.joint_pos.scale
  7. Measurement: the scrubber's checkpoints in this simulator, 20 s each from the default posemeasurements.json, results.checkpoints (scripts/measure-module-1.mjs)
  8. Measurement: how much exploration noise the built-in policy takes before it fallsmeasurements.json, results.noise (scripts/measure-module-1.mjs)
  9. J. Schulman, F. Wolski, P. Dhariwal, A. Radford and O. Klimov, Proximal Policy Optimization Algorithms, 2017
  10. N. Rudin, D. Hoeller, P. Reist and M. Hutter, Learning to Walk in Minutes Using Massively Parallel Deep Reinforcement Learning, CoRL 2021