Repository navigation
Specify the framework Gaussian agent in GNN with a pinned conformance gate - #3
Merged
Merged
Conversation
… gate Add gnn/gaussian_agent.gnn.md: the Generalized Notation Notation specification of the continuous linear-Gaussian agent in active_infer_ants/agent.py (identity dynamics and readout, Q/R carrying the prior and sensory precision parameters, the preferred-state prior, and the infer() posterior update), with ModelParameters recording num_dims, prior_precision, sensory_precision and learning_rate. gnn/upstream.json records the workstream pin (v5.0.3, 8f293d9ba810e6eda5c09842d9c7ed9ffa5f92c1). gnn_conformance.py extracts the specification from that pinned commit (git archive, never the checkout's working tree) with a GNN-capable interpreter and checks F/H, Q/R, the prior and the posterior update against the agent; scripts/validate_gnn_spec.py is the CLI gate and tests/test_gnn_conformance.py runs the structural half always, the pinned-parser half when the checkout is available. Signpost the specification, the gate and the related repositories in README.md, SPEC.md and AGENTS.md. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.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.
What changed
gnn/gaussian_agent.gnn.md— Generalized Notation Notation (GNN) specification of the continuous linear-Gaussian agent implemented inactive_infer_ants/agent.py: identity dynamicsFand readoutH, process noiseQ = I / prior_precision, sensory noiseR = I / sensory_precision, the preferred-state prior, and the precision-weighted posterior update thatinfer()performs.ModelParametersrecordsnum_dims,prior_precision,sensory_precisionandlearning_rate.gnn/upstream.json— the pinned GNN revision: v5.0.3,8f293d9ba810e6eda5c09842d9c7ed9ffa5f92c1.gnn_conformance.py— extracts the specification from that pinned commit viagit archive(never from the GNN checkout's working tree) and checks the extracted model against the package agent: dimensions, identityF/H,Q/R/prior, and thatinfer()equals the declared Gaussian posterior with the action set to the posterior mean. Continuous models need GNN's runtime dependencies, so the harness resolves a GNN-capable interpreter (GNN_PYTHON, then the checkout's.venv) and reports a clear unavailable state when there is none.scripts/validate_gnn_spec.py— CLI gate: exit 0 pass, 1 conformance failure, 2 GNN unavailable.tests/test_gnn_conformance.py— the structural half (pin record, all required sections, declared dimensions against the agent) always runs; the pinned-parser half skips when the GNN checkout is absent.README.md,SPEC.md,AGENTS.md— document the specification, the gate, and the related repositories (Generalized_Notation_Notation,ants,Active_Skillference).Verification on this branch
python -m py_compile, the CI step)python -m pytest -qpython -m pytest tests/test_gnn_conformance.py -qruff check gnn_conformance.py scripts/validate_gnn_spec.py tests/test_gnn_conformance.pypython scripts/validate_gnn_spec.pymodel_kind continuous, 3/3 dimensions, 4/4 checksThe gate reports the extracted specification as
continuouswithnum_states = num_observations = 3and checks: dimensions match the package agent;FandHare identity;Q,R,prior_meanandprior_covmatch the agent's Gaussian model;infer()performs the declared posterior update. Syntax was also checked with CPython 3.10 and 3.11 to match the CI matrix.