Log inStart free
LESSON 17.07 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Policy and value heads

Watch one encoder feed a policy head and a value head.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 17.07 · HEADS BAYSET ENCODER · SWAP GAP 0.00
01
Stage 1 of 6 · Encode the set
A set encoder reads each object with one small layer, then sums. A new object order gives the same h.
Explain it simply

The agent sees three objects: a goal, a wall and a coin. Each one goes through the same small layer. The four numbers per object are added up into h. Adding does not care about order, so the swapped copy below gets the same h.

Three objects go into the encoder. The features h are 0.46, −0.14, −0.29, 0.36. With the goal and the wall swapped, h is 0.46, −0.14, −0.29, 0.36.

observation, featuresweightshead outputsvalue gradient
goal0.60.3wall−0.40.5coin0.2−0.7objects: dx, dyset encoder12 weightsφφφΣ0.46−0.14−0.290.36hwall−0.40.5goal0.60.3coin0.2−0.7same encoder12 weightsφφφΣ0.46−0.14−0.290.36hgoal and wall swapped= hh = Σⱼ tanh(Wφ oⱼ + bφ)goal0.60.3wall−0.40.5coin0.2−0.7objects: dx, dyset encoder12 weightsφφφΣ0.46−0.14−0.290.36hwall−0.40.5goal0.60.3coin0.2−0.7same encoder12 weightsφφφΣ0.46−0.14−0.290.36hgoal and wall swapped= hh = Σⱼ tanh(Wφ oⱼ + bφ)
Toy: 3 objects, 4 features, random untrained weights
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
h=∑jtanh⁡(Wϕ oj+bϕ)\sy{h}{data}{h} = \sum_{j} \tanh(\sy{w}{param}{W_\phi}\, \sy{o}{data}{o_j} + \sy{w}{param}{b_\phi})
h=(0.46, −0.14, −0.29, 0.36)h = (0.46,\,-0.14,\,-0.29,\,0.36)

Each object passes the same layer, and the results add up.

Common mix-ups

MYTHA value-loss step cannot change the policy.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With a flat encoder, does a swap of the goal and the wall change h?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.