Brain v4 in a water maze
This is brain v4's real code (compiled to WebAssembly) and its trained minds, learning live in your browser. A hidden platform somewhere in the pool feeds it; every try it is put down somewhere new, and nothing points to the platform. It can only find it again from where it is (Morris's water maze). Tap the pool to move the platform, at any time.
By default you see the full brain: four specialist parts (each a 420 KB mind; two share one mind file) and the learned router that picks which part lives the life. Switch to the single 420 KB mind (v4_meta3) to compare them; the switch starts a new life with the same draws.
Tap or drag on the pool to move the hidden platform (the dashed circle; it does not see it).
Steps to the platform, one bar per try, the latest 120; orange: it ran out of time (80 thoughts). The line is the mean of the last 10. Dashed: you moved the platform.
What is going on
- What it senses: where it is, whether it bumped into the side, and the reward it just felt; nothing about the platform. What it does: two numbers move it; each life its moves are turned by a random quarter turn and given a random speed.
- A try ends on the platform (reward 1) or after 80 thoughts; then it is put down somewhere new, at least 0.6 from the platform. A "good try" is one that reached it in at most twice the straight distance.
- The full brain has four specialist parts, each a whole mind: the place part, the body-map part, the base mind (v4_meta3) and the place part with its memory of moves. Only one acts at a time. The life starts on the place part while the router watches: after 5, 10, 20, 40, 80 and 160 thoughts it compares what it has sensed with its memory of 1,600 earlier worlds, and as soon as the nearest ones clearly say which part did best there, that part lives the rest of the life (with a short trial: back to the place part if it earns less than expected). Of the routers we tested, this is the best: it scores above the router with three parts both on kinds of task it never trained on and on familiar ones, at least level with the best single part on the new kinds and well above it on the familiar ones.
- Memory of moves: the single mind carries a small whole-life memory of moves that failed (where it was, which way it moved, and then nothing changed, or it felt a loss) and leans firmly away from repeating them there. In the full brain this memory belongs to one part: the place part with its own whole-life memory of moves that failed and moves that paid, speaking only while that part acts.
- Learning happens only in this life: the minds' raised weights stay fixed and what they learn lives in their fast links and recurrent state. Reset brain starts a fresh life.
- What to expect: over the first few dozen tries it heads for the platform's place more and more directly. Move the platform and it searches the old place first, then learns the new one. In our runs here (64 lives each, the same draws for both brains, the platform moved at thought 6,000): before the move the full brain reached the platform in 82% of its last 20 tries, the single mind in 59%. After the move the full brain is behind: 46% of its last 20 tries against 57% for the single mind (11 points, 1.5 standard errors: a gap we see but cannot yet tell from noise). In most lives (53 of 64) the router gives this task to the place part with its memory of moves.
How it runs: the same WebAssembly file and mind files as the room demo (shared, so your browser loads them once). The task is Brain Gym's own watermaze code, unchanged; your edits change its state between two thoughts. On the same inputs the WebAssembly build gives bit-identical acts to the native build built with the same C maths library, and the router and the memory of moves give the research programs' own results.