Skip to content

Feature/ml - #107

Open
chemiskyy wants to merge 5 commits into
masterfrom
feature/ml
Open

Feature/ml#107
chemiskyy wants to merge 5 commits into
masterfrom
feature/ml

Conversation

@chemiskyy

Copy link
Copy Markdown
Member

No description provided.

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
Base automatically changed from feature/pyext to master September 9, 2026 13:48
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant