Exact controlled generation for variable-order Markov models. Train a model, define a regular language, and sample from the conditioned distribution—or find its most probable sequence.
Source & installation
·
0.4.0-rc.1 prerelease
·
npm package: npm install markov-constraints@next
Explore the Guillaume de Machaut melody laboratory →
Ready.
Your sequence will appear here.
If P(a)=0.60 and P(b)=0.40, greedy chooses a. But a splits equally into ax and ay, each with probability 0.30. If b always continues to x, bx is the most probable complete sequence at 0.40. Exact sampling explores all three with their conditional probabilities.