Feature/ml - #107
Open
chemiskyy wants to merge 5 commits into
Open
Conversation
Two recurrent cells share one interface, one UMAT wrapper and one fedoo law. A cell maps a strain history to the stress through an internal state that plays the role of the internal variables; StateModel (ml/cells.py) is the contract: a flat state vector stored in statev, one increment as step(x, s), and an optional closed-form tangent. StressLSTM (Danoun et al., Mech. Mater. 2022; CMAME 2024) is the gated cell: stacked nn.LSTM and a linear head, standardisation carried as buffers. LMSC (Bonatti and Mohr, JMPS 158 (2022) 104697, Eqs. 20-26) is the linearized minimal state cell. Its state relaxes exponentially towards a target along the arc length of the strain path, chi' = chi + expm1(-nu alpha)(chi - beta), written in increment form so that a zero increment returns chi bit for bit. That buys, by construction rather than by training: exact stationarity, exact self-consistency at frozen coefficients, structural rate independence, and a state of 6 to 20 scalars against the LSTM's 256. Its algorithmic tangent is closed form -- the total derivative, a partial derivative plus a state-sensitivity term -- so nothing is differentiated through the recurrence. RecurrentLaw serves either cell as a simcoon.PythonUMAT: the solver's rollback rewinds the network through statev, mixed stress/strain control is driven by the cell's tangent, and ndi 2 or 1 is handled by the local Newton condensation. LSTMLaw remains as an alias. Measured on J2 + Voce at a matched budget, deviation of a model from its own finest description of the same path: LMSC 0.06 % against 65 % for the gated cell under stress control. The committed-state rule bounds that departure for a gated cell under strain control only. Claude-Session: https://claude.ai/code/session_01Ni71E8DCPGa3NpbLZ3YboR
The BUILTIN_METRICS comment in identify.py used a :func: role pointing at simcoon.ml.torch_cost. simcoon.ml is an optional subpackage (extra "ml", PyTorch), so a documentation build of a tree without it — feature/pyext on its own, or an installation without the extra — leaves the reference unresolved. Plain literal instead; the core never depends on the subpackage, not even in its docstrings. Claude-Session: https://claude.ai/code/session_01Ni71E8DCPGa3NpbLZ3YboR
chemiskyy
force-pushed
the
feature/ml
branch
from
September 9, 2026 08:59
933d607 to
421596a
Compare
Introduce ArcSSM (arc-length state-space model) as a new recurrent cell: add python-setup/simcoon/ml/ssm.py implementing ArcSSM, linear_scan and coefficient nets with a top_lmsc option. Export ArcSSM from the ml package and update cells docstrings and API docs (docs/simulation/ml_lstm.rst) to describe the new model and its properties. Add extensive unit tests exercising forward/step consistency, stationarity, rate independence, numerical robustness, persistence and solver integration; include ArcSSM in existing parametrized tests. RecurrentLaw: add max_increment argument, store it and raise StepCut for absurd trial increments to avoid NaNs/overflows. Small fixes: use getattr(model, "psi_head", None) in train.py and adjust state/assembly naming and shapes in docs. Overall: adds a parallelizable structured SSM variant, integrates it into the package, and ensures solver-safe behaviour and test coverage.
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.
No description provided.