File size: 1,044 Bytes
d1e27d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
title: Clockwork RNN Pocket
emoji: ⏱️
colorFrom: orange
colorTo: blue
sdk: gradio
sdk_version: "6.5.1"
app_file: app.py
pinned: false
---

# Clockwork RNN Pocket

A modern, parameter-matched retest of periodic recurrent computation inspired by
the Clockwork RNN. Four eight-unit hidden blocks update at periods 1, 2, 4, and
8. The model competes with an ordinary tanh RNN and a smaller GRU on noisy
three-timescale forecasting.

All variants train on length-64 sequences and are evaluated both at that length
and zero-shot at length 256. The interactive Space overlays their predictions on
the same generated signal.

## Verified local result

All models contain exactly 1,153 parameters. At zero-shot length 256, Clockwork
RNN reached 0.0570 RMSE, versus 0.0492 for the ordinary RNN and 0.0466 for the
GRU. Periodic hidden updates did not improve this benchmark; the matched controls
make that negative result explicit.

```bash
uv run python projects/clockwork-rnn-pocket/train.py
uv run pytest tests/test_clockwork_rnn_pocket.py
```