Trellis estimation / lesson 06
Decode a coherent path through noise
The best state at every step is not always the best path through all steps.
Know what the primitive owns.
Problem
Pointwise selection follows every local spike. Sequential estimation trades observation fit against the cost of implausible transitions.
System boundary
The estimation package maximizes scores minus transition costs. It does not require or claim probabilities.
State changes become visible.
Inspectable: Per-step state score, transition cost, cumulative score, selected state, and full or fixed-lag path.
Change transition weight and watch the middle noise spike survive or disappear.
Static specimen / JavaScript adds controls without changing the lesson.
Same idea, honest surfaces.
const decoded = decodePath(trellis, {
transitionCost: (prev, next) =>
Math.abs(prev.value - next.value),
transitionWeight: 1,
});
console.log(decoded.stateIds); // ["0", "0", "0"]
decoded = decode_path(
trellis,
transition_cost=lambda prev, nxt, _step:
abs(prev.value - nxt.value),
transition_weight=1,
)
print(decoded.state_ids) # ["0", "0", "0"]
What this does not imply.
Scores may be log-likelihoods, but probabilities are optional. The primitive is a linear-chain energy maximizer.