Skip to content

v0.2.1

Latest

Choose a tag to compare

@Autoplectic Autoplectic released this 28 Sep 03:14
6faff4c

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 raises StochasticValidationError or returns degenerate machines, and it recovers the even, golden-mean, Nemo, and RkGM processes.
  • subtree_merge, stack_cssr, stack_subtree_merge, and transcssr get the same successor fix. subtree_merge no longer raises with its default delta. Stack CSSR reaches deep stacks and matches returns only to observed calls. transcssr recovers Delay(2).
  • HiddenMarkovStackModel.word_probability no longer returns 0 for words longer than about 50 symbols.
  • Seeded sample() is now reproducible across interpreter runs; symbol order no longer depends on PYTHONHASHSEED.
  • A MealyHMM built without an initial distribution starts from its stationary distribution, and add_transition adds new symbols to the observation alphabet.
  • Speed without sympy: is_symbolic no longer retries a failed import sympy on 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: default alpha changed from 0.05 to 0.01. Default Lmax is now ⌊log_k(n)/3⌋, between 1 and 10, instead of up to 15. min_count now also skips rarely seen suffixes.
  • subtree_merge with delta=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