Heater Playground 2
The room on the left is a simulation with constants you choose and the model never sees. Record some logs from it, train the four-weight model from the world models series on them, and the chart on the right shows how well it predicts a room outside the training range, next to the hand-written guess from the 101 post. Switch to the room with a door and the model gets a private field, from the 104 post, and the chart shows it working out a door the log never mentioned. Training there also fits the physics-shaped model from the 107 post, and the last section puts a planner on it and compares it with a thermostat over an evening.
1. The room
These are the constants the model is not told. The hand-written guess from the 101 post assumes a leak rate of 0.10 and a heater power of 1.5.
Someone opens the door about once every 25 steps and leaves it open for about 8. The logger never records it. Bring the open-door leak down towards the closed one and the door gets harder to hear.
2. Record logs
Press Record. A thermostat with a random setpoint runs the heater in rooms with outside temperatures between 2 and 12 degrees, and every state, action and next state is written down.3. Train
| four-weight model | learned | true |
|---|---|---|
| room | 0 | -0.07 |
| outside | 0 | 0.07 |
| heater | 0 | 1.2 |
| bias | 0 | 0 |
| latent model, act | observe | ||
|---|---|---|---|
| room | 0 | field | 0 |
| outside | 0 | room | 0 |
| heater | 0 | outside | 0 |
| bias | 0 | heater | 0 |
| field × room | 0 | change | 0 |
| field × outside | 0 | bias | 0 |
| field × bias | 0 |
| physics-shaped model | learned | true |
|---|---|---|
| leak, door shut | 0 | 0.07 |
| leak, door open | 0 | 0.25 |
| heater | 0 | 1.2 |
The physics-shaped model from the 107 post keeps the latent model's field and its observe step, and predicts with (leak + doorLeak × field) × (outside − room) + heat × heater. Its leaks are read off at the field's level in the right-hand room before and during the door.
4. A room it has never seen
Pick conditions outside the training range and watch the three predictions diverge. The real room includes draughts, so it jitters; the models do not.
5. Plan an evening
Forty steps. Someone wants the room at 12° or more until they arrive and at the target from then on. The planner runs the physics-shaped model forward 1,200 times a step (the cross-entropy method from the 107 post), does the first step of the best plan, sees the new reading and plans again. The thermostat comes on a degree above what is wanted, goes off 0.7 above that, and switches to the evening setting a fixed number of steps early.
The simulator, the training loops and the models are the code from Learning the Heater From Its Own Logs and Latent State Is the Fields You Never Logged, with the physics-shaped model and the planner from Planning Against the Model, all from the world models series. Four weights and gradient descent for the sealed room; thirteen weights, one private field and the same gradient descent run backwards through each episode for the room with the door, then nine weights with the field and the physics. Everything runs in your browser.