Repository navigation
Pass the observed choice to the CPN as its last input (#1324) - #1439
Open
AlexanderFengler wants to merge 17 commits into
Open
AlexanderFengler wants to merge 17 commits into
AlexanderFengler wants to merge 17 commits into
Conversation
Derived from tests/fixtures/ddm.onnx with LANfactory's derive-aux and trained with the unchanged torchtrain (tiny [32, 32] net, 5 epochs). Width 5: [v, a, z, t, choice] -> log P(choice | theta). Provenance alongside. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The CPN now takes [theta..., extra_fields..., choice] -> log P(choice | theta), the same shape the OPN has with the deadline, so HSSM wires it with params_only=False and assemble_callables hands it the response column of the missing-RT rows. An ONNX CPN/OPN whose input width is not n_params + 1 is rejected at construction with a pointer to #1324. params_only=True stays available for user callables that take only the parameters. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Without a deadline the CPN receives each missing row's response, so those rows must carry a code in model_config.choices; name the offending values. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Re-enable the CPN case of test_make_missing_data_callable (the is_vector=False case stays disabled with its note), pass the response column in the lapse missing-row tests, and hand the width-5 fixture its choice as a fifth scalar where the params-only branches are exercised. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Input layout [theta..., choice] against onnxruntime, the load-time width check on a hand-built (1, 4) graph, the missing-row response validation, and the end-to-end lapse mixture log((1-p) exp(cpn(theta, c)) + p/2) on missing rows of an hssm.HSSM model. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…1324) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…1324) - make_likelihood_callable / make_jax_logp_funcs_from_callable: params-only mode is for callables that take only the parameters; CPN and OPN artifacts take the choice / deadline as their last input - make_missing_data_callable gets its own contract note instead of delegating - LANLogpOp.make_node: data may be the network's single data column; None is the params-only user-callable path only - rename the params-only inner closure (no longer the CPN/OPN path) - type the width-check helper's loglik_missing_data like the constructor and note the second artifact load Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…es (#1324) - changelog and reference page describe the corpus layout to retrain on and link the issue for the tooling instead of naming a CLI that is not on any LANfactory release - state precisely where a params-only callable is still accepted (assemble_callables(params_only=True), invoked as f(None, *params)); the hssm.HSSM API always passes the choice - integration test header: deadline selects the data column, both networks use params_only=False Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- shared cpn_onnxruntime oracle fixture in conftest (was duplicated) - user callable: compare the per-row mixture on missing rows, not just finiteness, so it pins that the response column reaches the callable - pytensor CPN path: compare against onnxruntime on [theta..., choice] - unit-test _check_missing_data_network_input_width directly (n_params including extra fields, callables, NONE, symbolic dims) - pin the deadline gate of the missing-row response check - set missing rows' responses explicitly instead of asserting on ssms' draws - guard the fixture against its provenance (sha256, shape, sample outputs) - seed test_missing_and_deadline's data fixture Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
H1 (#1438) is now on main, so the shared #1322 commits drop out. One conflict, a docstring hunk in jax.py's make_jax_logp_funcs_from_callable: keep H2's sentence on the single-column missing-data callable and main's paragraph on the single-trial vmap signature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
H2 goes into the unreleased 0.5.1 with H1 (0.6.0 is kept for the bambi migration): its changelog entry becomes item 18 of 0.5.1 with the migration note under a breaking-changes subsection, and the width error, the reference page and the tests say 0.5.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's hssm.track records each ONNX load under the current network role. The width check loaded the missing-data network before the missing-data role was set, so tracking recorded the CPN as the likelihood network (test_tracking's two missing-data cases). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1436 took item 18 of the unreleased 0.5.1, so H2's changelog entry becomes item 19; the breaking-changes note stays at the end of 0.5.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This was referenced Oct 29, 2026
Validate CPNs and OPNs, and survey a LAN's mass over the whole box
lnccbrown/LAN_pipeline_minimal#68
Open
This branch has not been deployed
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.
Spine plan: https://github.com/lnccbrown/HSSMSpine/blob/main/plans/derive-aux-networks.md#pr-stack (step H2 of 8)
Depends on:
main(H1, #1438, is merged)Unblocks: CPNs on the Hub, which are promoted only once a release contains this; the pipeline's CPN
hssm_missing_loadgateCloses #1324
Why
rt == -999.0, no deadline) still has an observed choice, but the CPN was called with the parameters only. Every such row got the probability of one fixed choice, whichever choice the participant made.What
[θ…, choice] -> log P(choice | θ), the same layout the OPN already uses with the deadline ([θ…, deadline]). Both have input widthn_params + 1.HSSMwires the CPN withparams_only=False, like the OPN.assemble_callablessplices in theresponsecolumn for missing-RT rows and the deadline column for omission rows.hssm.track's missing-data role, so a tracked fit still records the CPN as its missing-data network.responseis not inchoicesnow raise a clearValueError. The data validator used to skip these rows.tests/fixtures/ddm_cpn.onnxis regenerated at width 5 from the DDM LAN fixture with LANfactory'sderive-aux. Its provenance is intests/fixtures/ddm_cpn.provenance.json.1 / n_choices).HSSM,HSSMBase,make_missing_data_callable,assemble_callables,make_jax_logp_funcs_from_callable) anddocs/reference/models-and-likelihoods.mddescribe the contract. Changelog: 0.5.1 item 19, plus a "Breaking changes" note.Migration (hand-trained CPNs only)
n_params) is rejected at build time. Retrain it on rows whose last column is the choice,[θ…, choice], labelled withP(choice | θ).franklab/HSSM, so no Hub artifact breaks.assemble_callables(..., params_only=True)still work. They are called asf(None, *params).Not in this PR
Tests
tests/test_cpn_choice_input.py(13 tests): the fixture against its provenance, the width error for a params-only CPN and a wrong-width OPN, invalid responses on missing rows, a user callable receiving the missing rows' response, and the missing-row log-likelihood against the lapse mixture of the CPN computed with onnxruntime.tests/test_missing_and_deadline.py: the CPN case runs again (JAX and PyTensor agree on value and gradient).tests/test_make_jax_single_trial_logp_from_networks.py: the input vector layout is pinned.tests/test_lapse_missing_rows.pyandtests/integration/test_missing_data_mcmc.py: H1's closed-form CPN test and the missing-data MCMC grid run under the new contract.🤖 Generated with Claude Code
Summary by CodeRabbit