Repository navigation
Bug-fix release for sample-based reconstruction and HMM sampling.
What's Changed
- Fix CSSR-family reconstruction, stack/sampling bugs, and is_symbolic cost by @Autoplectic in #13
Fixes
- CSSR (
cssr,EpsilonMachine.from_sequence) now follows Shalizi, Shalizi & Crutchfield (2002). Suffixes grow into the past, transient states are removed before determinizing, and truncated successors are resolved against the data. It no longer raisesStochasticValidationErroror returns degenerate machines, and it recovers the even, golden-mean, Nemo, and RkGM processes. subtree_merge,stack_cssr,stack_subtree_merge, andtranscssrget the same successor fix.subtree_mergeno longer raises with its defaultdelta. Stack CSSR reaches deep stacks and matches returns only to observed calls.transcssrrecoversDelay(2).HiddenMarkovStackModel.word_probabilityno longer returns 0 for words longer than about 50 symbols.- Seeded
sample()is now reproducible across interpreter runs; symbol order no longer depends onPYTHONHASHSEED. - A
MealyHMMbuilt without an initial distribution starts from its stationary distribution, andadd_transitionadds new symbols to the observation alphabet. - Speed without sympy:
is_symbolicno longer retries a failedimport sympyon every call;entropy_rate()on the 127-state Tetris bag went from 4.5 s to 0.04 s. The G-test is also inlined for faster inference.
Behavior changes
cssr: defaultalphachanged from 0.05 to 0.01. DefaultLmaxis now ⌊log_k(n)/3⌋, between 1 and 10, instead of up to 15.min_countnow also skips rarely seen suffixes.subtree_mergewithdelta=0: morphs now count as equal unless a G-test at 0.01 distinguishes them, instead of requiring agreement to within 1e-3.
Full Changelog: v0.2.0...v0.2.1