Efradeca commited on
Commit
e734bfb
·
verified ·
1 Parent(s): 3e77c56

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +184 -34
README.md CHANGED
@@ -1,50 +1,200 @@
1
  ---
2
  license: mit
3
  library_name: pytorch
4
- tags: [neural-operator, pde-solver, transolver, linear-attention, elasticity]
5
- metrics: [relative-l2]
 
 
 
 
 
 
 
6
  ---
7
 
8
- # LinearNO — Elastic Stress Surrogate (Geo-FNO Elasticity)
9
 
10
- Predicts the per-node **von Mises stress** of a hyper-elastic unit cell with a central void on
11
- the Geo-FNO **Elasticity** benchmark. Attention block: **LinearNO** (asymmetric linear attention,
12
- `shared_qk`, `project_out=False`), a drop-in
13
- replacement for Transolver's Physics-Attention.
14
 
15
- - **Test relative L2:** 0.005968 (this checkpoint).
16
- - **Params:** 582275 (≤ the Transolver baseline, 713,665).
17
- - **Interactive demo:** https://huggingface.co/spaces/Efradeca/elastic-stress-surrogate
18
 
19
- ## Results (Geo-FNO Elasticity test relative L2, mean ± std over 3 seeds)
20
 
21
- | Model | test rel-L2 | Params | Notes |
22
- |---|---|---|---|
23
- | Transolver baseline (reproduced) | 0.00678 ± 0.0012 | 713,665 | reproduces the published 0.0064 |
24
- | LinearNO | 0.00664 ± 0.0008 | 713,089 | baseline params; does **not** reach the paper's 0.0050 |
25
- | **LinearNO + equilibrium reg (this model)** | 0.00668 ± 0.0006 | 582,275 | accuracy preserved + **~360× lower ∇·σ residual** |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
- The equilibrium regularizer reduces the discrete equilibrium residual ‖∇·σ‖² by ~360× (6.1e6 1.7e4)
28
- with no accuracy cost, and this physical consistency is **maintained out-of-distribution** (OOD residual
29
- 1.7e4 vs in-dist 1.6e4). It does **not** improve OOD *accuracy* (degradation comparable to LinearNO)
30
- reported honestly, not massaged.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
- ## Usage
33
  ```python
34
- import torch, json
35
- from safetensors.torch import load_file
36
- from model import load_checkpoint # bundled loader (or use stress_operator.models.build_model)
 
 
 
 
 
37
  ```
38
 
39
- ## Honesty caveats (read these)
40
- 1. **Scope:** a *narrow* result on one benchmark — **not** a foundation model. The material is
41
- hyper-elastic (rubber-like), **not steel**; the method transfers, a steel result needs steel data.
42
- 2. **LinearNO** has no official public repo; it was reimplemented from the paper's equations
43
- (arXiv:2511.06294). Only the attention block differs from Transolver (ICML 2024, arXiv:2402.02366, MIT).
44
- 3. **Reproduction variance:** small dataset (1000 train) run-to-run variance; numbers are
45
- eager (deterministic), mean ± std over seeds {0,1,2}.
46
- 4. The interactive demo uses a **synthetic** mesh (no FEM ground truth for arbitrary void shapes).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  ## Citation
49
- Transolver (Wu et al., ICML 2024, arXiv:2402.02366) · LinearNO (Hu et al., AAAI 2026,
50
- arXiv:2511.06294) · Geo-FNO (Li et al., 2022, arXiv:2207.05209).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  library_name: pytorch
4
+ tags:
5
+ - neural-operator
6
+ - pde-solver
7
+ - physics-informed
8
+ - elasticity
9
+ - linear-attention
10
+ - transolver
11
+ metrics:
12
+ - relative-l2
13
  ---
14
 
15
+ # Model Card for Equilibrium-Regularized LinearNO — Elastic Stress Surrogate (Geo-FNO Elasticity)
16
 
17
+ A neural-operator surrogate that predicts the per-node von Mises stress field of a hyper-elastic
18
+ unit cell with a central void, on the **Geo-FNO Elasticity** benchmark. It maps a 2-D unstructured
19
+ mesh (972 nodes) directly to the stress field in milliseconds on CPU, replacing a per-geometry
20
+ finite-element (FEM) solve for fast design-space exploration.
21
 
22
+ ## Model Details
 
 
23
 
24
+ ### Model Description
25
 
26
+ The model is a Transolver-family transformer operator whose attention block is the asymmetric
27
+ linear-attention operator **LinearNO**. Its distinguishing component is an **equilibrium-residual
28
+ regularizer**: the network predicts the full stress tensor (σ_xx, σ_yy, σ_xy) and is penalized by a
29
+ discrete divergence operator so the predicted field approaches static mechanical equilibrium
30
+ (∇·σ 0), yielding physically consistent predictions at no measured accuracy cost.
31
+
32
+ - **Developed by:** Efradeca
33
+ - **Model type:** Neural operator (transformer PDE surrogate) for 2-D static hyper-elastic stress
34
+ - **Inputs / outputs:** node coordinates (B, 972, 2) → per-node von Mises stress (B, 972)
35
+ - **License:** MIT
36
+ - **Built on (not original to this work):** the **Transolver** solver (Wu et al., ICML 2024) and a
37
+ reimplementation of the **LinearNO** attention block (Hu et al., AAAI 2026). The original
38
+ contribution here is the equilibrium-residual regularizer and the out-of-distribution analysis.
39
+
40
+ ### Model Sources
41
+
42
+ - **Papers:** Transolver (arXiv:2402.02366); LinearNO (arXiv:2511.06294); Geo-FNO dataset (arXiv:2207.05209)
43
+ - **Demo:** https://huggingface.co/spaces/Efradeca/elastic-stress-surrogate
44
+
45
+ ## Uses
46
+
47
+ ### Direct Use
48
+
49
+ Millisecond-scale, CPU prediction of the von Mises stress field of a hyper-elastic unit cell with a
50
+ central void, for design-space exploration / shape optimization of the void (screen many candidate
51
+ geometries, then verify the few best with FEM).
52
+
53
+ ### Downstream Use
54
+
55
+ A starting point for fine-tuning to related geometries, materials, or boundary conditions, which
56
+ requires retraining on the corresponding FEM data.
57
+
58
+ ### Out-of-Scope Use
59
+
60
+ This is a narrow surrogate, not a general stress solver. It is **not** valid, without retraining,
61
+ for other materials (e.g. steel), other boundary conditions, or geometries outside the training
62
+ distribution, and it must not be used as a certified solver for safety-critical decisions.
63
+
64
+ ## Bias, Risks, and Limitations
65
 
66
+ - **Narrow domain:** a single benchmark, one hyper-elastic (rubber-like) material, one geometry
67
+ family (unit cell, central void, radius 0.2–0.4, clamped bottom, tensile top).
68
+ - **Run-to-run variance:** the training set is small (1000 samples), so per-seed results vary
69
+ noticeably; results are reported as mean ± std with the full per-seed distribution (see Evaluation).
70
+ - **Reimplemented component:** LinearNO has no official public reference implementation; it was
71
+ reproduced from the paper's equations.
72
+ - **Regularizer scope:** the supervised target is scalar von Mises stress; the tensor components are
73
+ latent and shaped by a *discrete* ∇·σ penalty (validated against analytic fields), which is a
74
+ physical-consistency prior, not exact continuous momentum balance.
75
+ - **Out-of-distribution:** accuracy degrades on geometries far from the training distribution
76
+ (extreme voids); the regularizer maintains physical consistency OOD but does not improve OOD accuracy.
77
+
78
+ ### Recommendations
79
+
80
+ Use within the training distribution; verify any safety-critical prediction with FEM; monitor the
81
+ equilibrium residual ‖∇·σ‖² as a physical-consistency indicator.
82
+
83
+ ## How to Get Started with the Model
84
 
 
85
  ```python
86
+ from huggingface_hub import snapshot_download
87
+ from model import load_checkpoint, predict_stress # bundled with the repo
88
+
89
+ repo = snapshot_download("Efradeca/transolver-linearno-elasticity")
90
+ model, normalizer, info = load_checkpoint(f"{repo}/model.safetensors", device="cpu")
91
+
92
+ # coords: (N, 2) node coordinates of a unit cell with a central void
93
+ stress = predict_stress(model, coords, normalizer, info) # (N,) von Mises stress
94
  ```
95
 
96
+ ## Training Details
97
+
98
+ ### Training Data
99
+
100
+ Geo-FNO Elasticity (Li et al., 2022): FEM simulations of a hyper-elastic unit cell with a random
101
+ central void (radius 0.2–0.4), 972 nodes per sample, per-node von Mises stress. Split: 1000 train /
102
+ 200 test (first-1000 / last-200 of 2000, following the upstream Transolver protocol).
103
+
104
+ ### Training Procedure
105
+
106
+ #### Preprocessing
107
+
108
+ Global z-score normalization of the stress target (de-normalized before the metric). The
109
+ equilibrium-regularized model outputs three stress-tensor channels and derives von Mises.
110
+
111
+ #### Training Hyperparameters
112
+
113
+ - **Architecture:** 8 layers, hidden dim 128, 8 heads, dim_head 16, slices M = 64;
114
+ attention `linearno` (variant `shared_qk`, project_out=`False`)
115
+ - **Optimization:** AdamW, lr 1e-3, weight decay 1e-5, cosine annealing, 500 epochs, batch size 1,
116
+ gradient clipping 0.1
117
+ - **Loss:** relative L2 + λ·‖∇·σ‖² on interior nodes (λ = 0.01)
118
+ - **Seeds:** {0, 1, 2} (mean ± std reported)
119
+
120
+ ## Evaluation
121
+
122
+ ### Testing Data, Factors & Metrics
123
+
124
+ - **Testing data:** the 200 held-out FEM meshes.
125
+ - **Factors:** in-distribution vs. out-of-distribution (geometry-stratified by void size).
126
+ - **Metrics:** relative L2 (primary); the discrete equilibrium residual ‖∇·σ‖²; per-node Pearson r
127
+ and R² against the FEM ground truth; peak-stress relative error.
128
+
129
+ ### Results
130
+
131
+ Geo-FNO Elasticity test relative L2 (mean ± std over seeds; per-seed values shown because variance
132
+ is large and is not hidden):
133
+
134
+ | Model | mean ± std | per-seed | params |
135
+ |---|---|---|---|
136
+ | Published Transolver (Wu et al. 2024) | 0.0064 | — | ~0.7M |
137
+ | Published LinearNO (Hu et al. 2026, M=64) | 0.0050 | — | — |
138
+ | Transolver baseline (this work, reproduced) | 0.00678 ± 0.0012 | 0.00587 / 0.00606 / 0.00841 | 713,665 |
139
+ | LinearNO (this work, reimplemented) | 0.00741 ± 0.0025 | 0.00592 / 0.00545 / 0.01086 | 713,089 |
140
+ | **+ equilibrium regularizer (this model)** | 0.00668 ± 0.0006 | 0.00597 / 0.00653 / 0.00754 | 582,275 |
141
+
142
+ **Physical consistency.** The regularizer reduces the discrete equilibrium residual ‖∇·σ‖² by
143
+ **~360×** (6.1e6 → 1.7e4) at no measured accuracy cost, and this consistency is maintained
144
+ out-of-distribution (OOD residual 1.73e4 vs. in-distribution 1.61e4).
145
+
146
+ **Verification against FEM ground truth** (200 test meshes): per-sample relative L2 mean 0.00597
147
+ (median 0.00533), pooled Pearson r = 0.9999, R² = 0.9999, peak-stress relative error 0.3%.
148
+
149
+ #### Summary
150
+
151
+ The reproduced Transolver baseline matches the published 0.0064 within ~6%. On accuracy, LinearNO and
152
+ the regularized model are statistically comparable to the baseline at ≤ its parameter count; we do
153
+ not claim an accuracy improvement (two of three LinearNO seeds reach the published level while one
154
+ seed lands in a degenerate generalization basin, inflating the 3-seed mean). The contribution is
155
+ physical consistency: a stress field that satisfies discrete static equilibrium, preserved under
156
+ covariate shift, at no accuracy cost and with fewer parameters than the baseline.
157
+
158
+ ## Technical Specifications
159
+
160
+ ### Model Architecture and Objective
161
+
162
+ Transolver-family transformer (encoder → 8 pre-norm blocks → linear decoder head) with the LinearNO
163
+ asymmetric linear-attention block; objective = relative-L2 data loss + equilibrium-residual penalty.
164
+
165
+ ### Compute Infrastructure
166
+
167
+ - **Hardware:** single NVIDIA A10 GPU (Modal).
168
+ - **Software:** PyTorch, einops, safetensors; CPU inference for the demo.
169
 
170
  ## Citation
171
+
172
+ **BibTeX:**
173
+ ```bibtex
174
+ @inproceedings{wu2024transolver,
175
+ title={Transolver: A Fast Transformer Solver for PDEs on General Geometries},
176
+ author={Wu, Haixu and Luo, Huakun and Wang, Haowen and Wang, Jianmin and Long, Mingsheng},
177
+ booktitle={International Conference on Machine Learning (ICML)},
178
+ year={2024}
179
+ }
180
+ @inproceedings{hu2026linearno,
181
+ title={Transolver is a Linear Transformer: Revisiting Physics-Attention through the Lens of Linear Attention},
182
+ author={Hu and Liu and Qiao and Sun and Dou},
183
+ booktitle={AAAI Conference on Artificial Intelligence},
184
+ year={2026}
185
+ }
186
+ @article{li2022geofno,
187
+ title={Fourier Neural Operator with Learned Deformations for PDEs on General Geometries},
188
+ author={Li, Zongyi and others},
189
+ journal={arXiv:2207.05209},
190
+ year={2022}
191
+ }
192
+ ```
193
+
194
+ ## Model Card Authors
195
+
196
+ Efradeca.
197
+
198
+ ## Model Card Contact
199
+
200
+ https://huggingface.co/Efradeca