feat(solver): add dynamical bias hook and filtered state to CaSuDaSolver - #116
Open
gcattan wants to merge 1 commit into
Open
feat(solver): add dynamical bias hook and filtered state to CaSuDaSolver#116gcattan wants to merge 1 commit into
gcattan wants to merge 1 commit into
Conversation
Step 1 of the dynamical / RTRBM direction. Backward-compatible, opt-in. - bias_func(run, m, m_filt): per-timestep hook that replaces the static h, enabling recurrence (RTRBM) and adaptive biasing. Defaults to None, in which case behavior is bit-for-bit identical to before. - m_filt: leaky-integrator companion state (graded [-1, 1]), controlled by a new solver `tau` param. It carries step (run-1) when bias_func is called, giving the hook temporal memory; never affects the hard +/-1 sampler unless a bias_func consumes it. - return_filtered: opt-in to append the m_filt trajectory to the return; the default return contract is unchanged for both n_shots==1 and n_shots>1. - Energy E now uses the effective (biased) h so it stays consistent with all_I when a bias_func is active. Adds tests/test_dynamical.py covering backward compatibility, filtered-state bounds, the hook feeding the dynamics, energy-reflects-bias, multi-shot shapes and per-shot broadcasting, and tau=0/tau=1 filter invariants. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of the dynamical / RTRBM direction. Backward-compatible, opt-in.
tauparam. It carries step (run-1) when bias_func is called, giving the hook temporal memory; never affects the hard +/-1 sampler unless a bias_func consumes it.Adds tests/test_dynamical.py covering backward compatibility, filtered-state bounds, the hook feeding the dynamics, energy-reflects-bias, multi-shot shapes and per-shot broadcasting, and tau=0/tau=1 filter invariants.