Commit Graph
4 Commits
Author SHA1 Message Date
jensandClaude Sonnet 4.6 bbc03d37e1 [context33] - 200-char sentence, auto-uppercase, adaptive tick spacing
SENTENCE now accepts mixed case and strips non-vocab chars automatically.
Extended to ~200 chars using the Moby Dick opening passage.
Visualisation cells use adaptive tick spacing (max 40 labels) to handle
longer sequences without crowding.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 16:15:01 +02:00
jensandClaude Sonnet 4.6 0beb7a5c1b [context33] - replace armadillo data with 20-char sentence, moby encoding
Remove context33.training.dat loading (and read_armadillo import).
Training data is now a hardcoded 20-character sentence encoded with the
same 40-char vocabulary as moby_rnn.ipynb (space .!? A-Z 0-9).

  SENTENCE = "MOBY DICK IS A WHALE"

Results: 95% reconstruction, 95% next-step prediction (one miss each
on the first character where context is zero).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:35:59 +02:00
jensandClaude Sonnet 4.6 5506fef0fa [context33] - fix row order; sequence now reads 1 5 6 9 … R U X
The training.dat file stores samples LIFO (last added in the C++ GUI = row 0).
Reversing the rows restores chronological order, matching the C++ sequence.

Next-step prediction remains 100%: model predicts x_{t+1} from h_t correctly
in the C++ insertion order 1 5 6 9 B F I L Q R U X.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:22:43 +02:00
jensandClaude Sonnet 4.6 2a6b00db88 [context33] - pyRBM port of context33.prj; predict next char from current context
Notebook reconstructs the C++ context33.prj configuration exactly:
  - shared-weights StackRnn (1 entity, reused every time step)
  - visible = [context(128) | x_t(40)] = 168 units, hidden = 128
  - all hyperparams from .prj: lr=0.05, momentum=0.5, epochs=1000,
    mini_batch=100, gibbs=3, rao_blackwell=True, weight_decay=0

Training data loaded directly from context33.training.dat (Armadillo format,
12 × 168): sensory one-hot chars decoded as 'XURQLIFB9651'.

Key design: training pairs are (h_t, x_{t+1}) not (h_{t-1}, x_t) —
context is first advanced by seeing x_t, then the model is trained to
predict the next character x_{t+1} from that context. Evaluation using
clamped Gibbs on h_t achieves 100% next-step prediction accuracy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:12:14 +02:00