Repository navigation
physXAI 1.0.0 – Phase 2: expression language and modular ANN - #72
Merged
Merged
Conversation
…es and modular expressions - physXAI.expr: immutable expression graph (Vars namespace, Var, Const, Param, arithmetic, activations) with NumPy, Keras and CasADi backends, deterministic names, lag(), substitute() and json serialization with shared nodes - Trainable blocks Linear, MLP, MonotoneMLP, Polynomial, RBF, Mean, Normalize, Pretrained; blocks normalize their inputs, arithmetic stays physical - ModularANN on a graph with solver 'adam' or 'ols' (closed form linear regression on expressions), architecture embedded in the model config - Preprocessing: inputs derived from the model (contract order), expression columns for derived data (e.g. PINN targets) - ConstrainedRegression and RNN feature architectures ported; constrained regression layer name fixed for the CasADi export - Removed physXAI.preprocessing.constructed and modular_expression with all global registries; executables, examples and tests migrated - Contract tests: CasADi translation of every block, in-model derived input exported as KerasANN on raw inputs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
…models - physXAI.evaluation.rollout: recursion derived from the names (Change(X) / X and lags), RecursiveCell (keras RNN cell around the step model) with recomputation of derived columns depending on the recursive feature, RMSE / MAE / bias per step of the horizon for every split - Single step models evaluate the horizon automatically with PreprocessingSingleStep(eval_horizon='24h'); horizon plot - physXAI.training.RecursiveTraining: training on the multi step error with weighted first step, modes single_then_multi / multi_step, also as fine tuning of OLS solutions; the saved model stays a single step model - Fixes: in-place writes of the legacy multi step evaluation, BuildContext id reuse, early stopping without validation data, seeding at creation - Example TAir_recursive.py, tests for exact rollouts, recomputed columns, bias, lags, absolute outputs and the recursive training Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
- pull_request also triggers on 'edited', the jobs run only if the base branch changed (GitHub retargets stacked PRs after a merge) - the coverage badge is only committed for PRs into main - executables/regression_prototype.py (experimental) is not verified Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
physXAI 1.0.0 – Phase 3: recursive multi step evaluation and training
Open
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.
Phase 2 of the physXAI 1.0.0 refactoring: one expression language for physics and trainable blocks. Stacked on #71 (base
v1/phase-1-data; retarget torefactoring_v1.0.0after #71 is merged).Summary
physXAI.exprreplaces constructed features and modular expressions (no global registries any more):lag()andsubstitute()are available.Linear,MLP,MonotoneMLP(CMNN),Polynomial,RBF,Mean,Normalize,Pretrained. Blocks normalize their inputs, arithmetic works on raw physical values.modular_expression_config.jsonis gone.vT.solver='ols'solves a linear regression on expressions in closed form.columns={'vT': expr}adds a data column. This is also used for PINN targets.ConstrainedRegression(fixed: its layer name had nodense, so the CasADi export failed; a second fit duplicated the constraints) and the RNNfeature_architecture.unittests/modulartest is replaced by independent tests.Contract
modular_linregcontract script:vTinside the model. The exported KerasANN has inputsmDot, load, T_inwithTrecursive; OLS recovers the simulated physics within 0.1 %.Test plan
pytest: 91 passed.run_example(testing=True)runs.executables/run (smoke test with 1 epoch).Notes
executables/regression_prototype.pydoes not use physXAI and needs matplotlib, which is not a dependency, soverify_executableswould fail on it once it changes. Should it move out ofexecutables/?🤖 Generated with Claude Code