Previously a single shared-weight Entity processed every time step. Now:
- Shared mode (1 layer via make_layer): original behaviour unchanged
- Unrolled mode (N layers via make_unrolled): layers[t] owns W_t, b_v_t, b_h_t
New API:
make_unrolled(T, sensory_size, h_size, ...) → list[Layer]
next_entity() → Entity for the upcoming step() call
current_entity() → Entity from the most recent step() call
is_shared → bool
moby_rnn.ipynb: switch Build model cell to make_unrolled(T=100); update
predict_next() to use rnn.next_entity() for position-correct Gibbs sampling
README_moby_rnn.md: redraw temporal-unrolling ASCII art showing per-position
weights W_t; update parameter count and checkpoint file listing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README_moby_rnn.md: single-step and temporally-unrolled ASCII diagrams,
configuration table, notebook cell guide, generation API docs, references
- moby_rnn.ipynb: move all constants (T, NUM_SEQ, EVAL_CHARS, PRED_CHARS,
N_GIBBS, SEED, SEQ_IDX) into the Build model cell under a Configuration
header; rename H_SIZE → CONTEXT_SIZE throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements StackRnn: a cascaded/recurrent RBM where the visible layer at
each time step is the concatenation of the previous hidden state (context)
and the current sensory input — V[t] = [context | x_t]. Weights are
shared across time steps (RTRBM-style concatenation variant).
- stack_rnn.py: StackRnn with step(), reconstruct(), reset(), train(),
make_layer() factory; supports greedy layer-wise training over sequences
of shape (num_seq, T, sensory_size)
- test_rnn.py: single-layer, two-layer, and save/load tests
- moby_rnn.ipynb: character-level language model on Moby Dick; one-hot
encoding, clamped-Gibbs next-char prediction, free text generation,
hidden-state trace and character-distribution visualisations
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>