HaomingLuo commited on
Commit
8d6f23a
·
verified ·
1 Parent(s): 0ef4ba2

Add DENIM evidence v3 protocols

Browse files

Frozen data ablation, leave-one-family-out and stratified 16/64-trajectory adaptation evidence; no test leakage.

ARTICLE_EVIDENCE_V3_SHA256SUMS ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 957eeda4af6adf7fa0c7388d46d74cba04cb1fb1654d9cb1151e0b8b5925ddc9 CONDITIONAL_V2_SHA256SUMS
2
+ f99d140652e1c98ce39951be5e73690e58a66750336de8d16bf252c8777ace84 README.md
3
+ 54b5758b3c3ea75e3f11b701209b7a3f8bd73691f7b48bd701e4112c94dc68db article_evidence_v3/README.md
4
+ 32d7ed305c6a32587be7b97448970388856e52482712c632409255e74efccb10 article_evidence_v3/evidence_metrics.json
5
+ b86cdeb5e109beef399332d84fe174ff59e83f03f251451dd4d7beb359573260 article_evidence_v3/protocol.json
6
+ 53e80543f77326c9051dca766e045ab3390d96e5cb684cbf221df164c9ceb9d6 article_evidence_v3/run_t2_denim_evidence_v3.py
7
+ 84173c7a9e5fce83601b40d178f37cdb7030b46117839fb3b3fec4e62a269d7e conditional_v2/README.md
8
+ 28725b2db1a303c86d0d9c9268ceea2bf6faaddfe2df167457fd3bd8e8e794de conditional_v2/SHA256SUMS
9
+ f2ba3f8d4af49eaec284e6ab776cc65eb80ac81139b800889765881dc14bfc0b conditional_v2/artifacts/t2_denim_conditional_v2/model_metrics.json
10
+ 85c96f7d4954839fe99b8f741e6eaab19b0b6b47b87e19d3c3172853d0f3dba5 conditional_v2/artifacts/t2_denim_conditional_v2/physical_runtime_validation.json
11
+ 4c9fa10a3235892714d50d92e174663dbbac9e4162c964d739ffee28721b1873 conditional_v2/artifacts/t2_denim_conditional_v2/refined_metrics.json
12
+ f7ef24867baa630310c9c391a7d4df3fc048fb501ea240a728a4cb6ade0ff7ae conditional_v2/docs/T2_CONDITIONAL_DENIM_V2.md
13
+ 08f70f7cb3bebd63859cd0b2626775dda85cc738b8dad2fc77c5d8a80033a7b3 conditional_v2/src/infer_t2_denim_conditional_v2.py
14
+ 2d6b4b705f81250a447c7e59ded54815204cc923ccfbb4d87488844c47b10691 conditional_v2/src/refine_t2_denim_conditional_v2.py
15
+ 85b288ee63a862dc9698e501c9f691ec4b8ab772dde7f20109ab9222a1c6d874 conditional_v2/src/t2_denim_conditional.py
16
+ 40bd1d10cf1ea285bb7b88990ace757ba128e88e4dcf84d208dca8c2df1b5c4c conditional_v2/src/train_t2_denim_conditional_v2.py
17
+ 47f5c2635a6702926b26fee2b28aacc94e333686f9a4bf672f6b58a41191a9d1 conditional_v2/src/validate_t2_denim_conditional_v2.py
18
+ a940f94318c4143acbc9a360efdd84370e616bf1b0fd842d8c3c5d505f8eefc8 conditional_v2/tests/test_t2_denim_conditional.py
README.md CHANGED
@@ -188,3 +188,8 @@ The releases are synthetic, small-strain material-point benchmarks. They do
188
  not constitute experimental calibration, fatigue-life prediction, damage,
189
  finite-strain plasticity or a production-certified learned material. Data are
190
  CC BY 4.0; code files are covered by the included code license.
 
 
 
 
 
 
188
  not constitute experimental calibration, fatigue-life prediction, damage,
189
  finite-strain plasticity or a production-certified learned material. Data are
190
  CC BY 4.0; code files are covered by the included code license.
191
+
192
+
193
+ ## Evidence protocol v3
194
+
195
+ See `article_evidence_v3/` for frozen ablation and leave-one-family-out split definitions.
article_evidence_v3/README.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # DENIM evidence protocol v3
2
+
3
+ This directory adds reproducible split and adaptation protocols to the existing 2,660-trajectory dataset. It does not duplicate or reassign the published trajectories. Training, validation, and test roles remain frozen; test trajectories are evaluation-only.
4
+
5
+ The evidence matrix covers 80/330 incomplete-family trajectories, transfer from 1,154 declared-physics trajectories, leave-one-family-out zero-shot evaluation, and 16/64-trajectory adaptation.
article_evidence_v3/evidence_metrics.json ADDED
@@ -0,0 +1,704 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "agentfem.denim-evidence.v3",
3
+ "frozen_protocol": {
4
+ "total_trajectories": 2660,
5
+ "train": 1484,
6
+ "validation": 407,
7
+ "test": 769,
8
+ "family_counts": {
9
+ "j2_linear_isotropic": {
10
+ "train": 577,
11
+ "validation": 171,
12
+ "test": 268
13
+ },
14
+ "chaboche_combined": {
15
+ "train": 577,
16
+ "validation": 170,
17
+ "test": 269
18
+ },
19
+ "hidden_three_memory_tabulated_hardening": {
20
+ "train": 330,
21
+ "validation": 66,
22
+ "test": 232
23
+ }
24
+ },
25
+ "selection_rule": "deterministic round-robin across path families; held-family training trajectories only"
26
+ },
27
+ "ablation": {
28
+ "hidden_80_scratch": {
29
+ "training": {
30
+ "steps": 1400,
31
+ "seconds": 18.30456762504764,
32
+ "best_validation_loss": 2.075452357530594e-05
33
+ },
34
+ "evaluation": {
35
+ "hidden_frozen_test": {
36
+ "trajectory_count": 32,
37
+ "rmse_mpa": 0.5097740292549133,
38
+ "mae_mpa": 0.28684791922569275,
39
+ "r2": 0.9999802112579346,
40
+ "state_point_count": 7712
41
+ },
42
+ "test_amplitude_ood": {
43
+ "trajectory_count": 60,
44
+ "rmse_mpa": 1.3261798620224,
45
+ "mae_mpa": 0.4734494984149933,
46
+ "r2": 0.9998748302459717,
47
+ "state_point_count": 14460
48
+ },
49
+ "test_discretization": {
50
+ "trajectory_count": 20,
51
+ "rmse_mpa": 0.4494419991970062,
52
+ "mae_mpa": 0.2459268420934677,
53
+ "r2": 0.9999846816062927,
54
+ "state_point_count": 8120
55
+ },
56
+ "test_long_horizon": {
57
+ "trajectory_count": 40,
58
+ "rmse_mpa": 9.0242338180542,
59
+ "mae_mpa": 3.596944570541382,
60
+ "r2": 0.9937672019004822,
61
+ "state_point_count": 9640
62
+ },
63
+ "test_path_ood": {
64
+ "trajectory_count": 80,
65
+ "rmse_mpa": 0.548997700214386,
66
+ "mae_mpa": 0.2917637825012207,
67
+ "r2": 0.999976396560669,
68
+ "state_point_count": 19280
69
+ }
70
+ }
71
+ },
72
+ "hidden_330_scratch": {
73
+ "training": {
74
+ "steps": 1400,
75
+ "seconds": 18.037176416022703,
76
+ "best_validation_loss": 2.017221959249582e-05,
77
+ "protocol": "hyperparameter_matched_to_hidden_80_scratch"
78
+ },
79
+ "evaluation": {
80
+ "hidden_frozen_test": {
81
+ "trajectory_count": 32,
82
+ "rmse_mpa": 0.5325977206230164,
83
+ "mae_mpa": 0.2931683659553528,
84
+ "r2": 0.9999784231185913,
85
+ "state_point_count": 7712
86
+ },
87
+ "test_amplitude_ood": {
88
+ "trajectory_count": 60,
89
+ "rmse_mpa": 1.385399341583252,
90
+ "mae_mpa": 0.4937373101711273,
91
+ "r2": 0.9998633861541748,
92
+ "state_point_count": 14460
93
+ },
94
+ "test_discretization": {
95
+ "trajectory_count": 20,
96
+ "rmse_mpa": 0.46980738639831543,
97
+ "mae_mpa": 0.25197768211364746,
98
+ "r2": 0.9999832510948181,
99
+ "state_point_count": 8120
100
+ },
101
+ "test_long_horizon": {
102
+ "trajectory_count": 40,
103
+ "rmse_mpa": 9.191946983337402,
104
+ "mae_mpa": 3.683844566345215,
105
+ "r2": 0.9935333728790283,
106
+ "state_point_count": 9640
107
+ },
108
+ "test_path_ood": {
109
+ "trajectory_count": 80,
110
+ "rmse_mpa": 0.5769456624984741,
111
+ "mae_mpa": 0.2999087870121002,
112
+ "r2": 0.9999739527702332,
113
+ "state_point_count": 19280
114
+ }
115
+ }
116
+ },
117
+ "known_1154_plus_hidden_80": {
118
+ "training": {
119
+ "steps": 1400,
120
+ "seconds": 39.2154094169382,
121
+ "best_validation_loss": 8.18048438304686e-05
122
+ },
123
+ "evaluation": {
124
+ "hidden_frozen_test": {
125
+ "trajectory_count": 32,
126
+ "rmse_mpa": 1.457561731338501,
127
+ "mae_mpa": 0.7716607451438904,
128
+ "r2": 0.9998383522033691,
129
+ "state_point_count": 7712
130
+ },
131
+ "test_amplitude_ood": {
132
+ "trajectory_count": 60,
133
+ "rmse_mpa": 3.7529003620147705,
134
+ "mae_mpa": 1.438835859298706,
135
+ "r2": 0.9989975690841675,
136
+ "state_point_count": 14460
137
+ },
138
+ "test_discretization": {
139
+ "trajectory_count": 20,
140
+ "rmse_mpa": 1.5815093517303467,
141
+ "mae_mpa": 0.7716865539550781,
142
+ "r2": 0.9998104572296143,
143
+ "state_point_count": 8120
144
+ },
145
+ "test_long_horizon": {
146
+ "trajectory_count": 40,
147
+ "rmse_mpa": 7.19581937789917,
148
+ "mae_mpa": 2.662142515182495,
149
+ "r2": 0.9960370063781738,
150
+ "state_point_count": 9640
151
+ },
152
+ "test_path_ood": {
153
+ "trajectory_count": 80,
154
+ "rmse_mpa": 1.4498724937438965,
155
+ "mae_mpa": 0.7752851247787476,
156
+ "r2": 0.9998355507850647,
157
+ "state_point_count": 19280
158
+ }
159
+ }
160
+ },
161
+ "known_1154_plus_hidden_330": {
162
+ "training": {
163
+ "steps": 1400,
164
+ "seconds": 37.73902383283712,
165
+ "best_validation_loss": 8.374246726816637e-05,
166
+ "protocol": "hyperparameter_matched_to_known_1154_plus_hidden_80"
167
+ },
168
+ "evaluation": {
169
+ "hidden_frozen_test": {
170
+ "trajectory_count": 32,
171
+ "rmse_mpa": 1.5190730094909668,
172
+ "mae_mpa": 0.8048877716064453,
173
+ "r2": 0.9998244047164917,
174
+ "state_point_count": 7712
175
+ },
176
+ "test_amplitude_ood": {
177
+ "trajectory_count": 60,
178
+ "rmse_mpa": 3.729703903198242,
179
+ "mae_mpa": 1.4087541103363037,
180
+ "r2": 0.9990099668502808,
181
+ "state_point_count": 14460
182
+ },
183
+ "test_discretization": {
184
+ "trajectory_count": 20,
185
+ "rmse_mpa": 1.656106948852539,
186
+ "mae_mpa": 0.8177827000617981,
187
+ "r2": 0.9997920989990234,
188
+ "state_point_count": 8120
189
+ },
190
+ "test_long_horizon": {
191
+ "trajectory_count": 40,
192
+ "rmse_mpa": 7.5080790519714355,
193
+ "mae_mpa": 2.7841875553131104,
194
+ "r2": 0.9956855773925781,
195
+ "state_point_count": 9640
196
+ },
197
+ "test_path_ood": {
198
+ "trajectory_count": 80,
199
+ "rmse_mpa": 1.5116416215896606,
200
+ "mae_mpa": 0.8086093664169312,
201
+ "r2": 0.9998212456703186,
202
+ "state_point_count": 19280
203
+ }
204
+ }
205
+ }
206
+ },
207
+ "leave_one_family_out": {
208
+ "j2_linear_isotropic": {
209
+ "held_out_family": "j2_linear_isotropic",
210
+ "base_training": {
211
+ "steps": 1400,
212
+ "seconds": 39.81002512504347,
213
+ "best_validation_loss": 0.0014799873461015522
214
+ },
215
+ "zero_shot": {
216
+ "trajectory_count": 268,
217
+ "rmse_mpa": 49.748207092285156,
218
+ "mae_mpa": 30.285388946533203,
219
+ "r2": 0.8084170818328857,
220
+ "state_point_count": 57388
221
+ },
222
+ "adaptation": {
223
+ "16": {
224
+ "training": {
225
+ "steps": 900,
226
+ "seconds": 20.13811704190448,
227
+ "best_validation_loss": 0.0008964448315964546
228
+ },
229
+ "selection": "path-family-balanced round-robin",
230
+ "training_trajectory_ids": [
231
+ 337,
232
+ 1,
233
+ 1264,
234
+ 1200,
235
+ 1009,
236
+ 1072,
237
+ 1136,
238
+ 252,
239
+ 169,
240
+ 85,
241
+ 420,
242
+ 338,
243
+ 2,
244
+ 1265,
245
+ 1202,
246
+ 1010
247
+ ],
248
+ "evaluation": {
249
+ "trajectory_count": 268,
250
+ "rmse_mpa": 3.864365577697754,
251
+ "mae_mpa": 1.7006479501724243,
252
+ "r2": 0.9988440275192261,
253
+ "state_point_count": 57388
254
+ }
255
+ },
256
+ "64": {
257
+ "training": {
258
+ "steps": 1200,
259
+ "seconds": 33.06111670914106,
260
+ "best_validation_loss": 0.00058859380078502
261
+ },
262
+ "selection": "path-family-balanced round-robin",
263
+ "training_trajectory_ids": [
264
+ 337,
265
+ 1,
266
+ 1264,
267
+ 1200,
268
+ 1009,
269
+ 1072,
270
+ 1136,
271
+ 252,
272
+ 169,
273
+ 85,
274
+ 420,
275
+ 338,
276
+ 2,
277
+ 1265,
278
+ 1202,
279
+ 1010,
280
+ 1074,
281
+ 1139,
282
+ 253,
283
+ 170,
284
+ 86,
285
+ 421,
286
+ 339,
287
+ 3,
288
+ 1267,
289
+ 1203,
290
+ 1011,
291
+ 1076,
292
+ 1143,
293
+ 257,
294
+ 171,
295
+ 87,
296
+ 422,
297
+ 340,
298
+ 6,
299
+ 1270,
300
+ 1204,
301
+ 1012,
302
+ 1078,
303
+ 1145,
304
+ 259,
305
+ 172,
306
+ 88,
307
+ 424,
308
+ 341,
309
+ 7,
310
+ 1271,
311
+ 1206,
312
+ 1013,
313
+ 1079,
314
+ 1147,
315
+ 261,
316
+ 174,
317
+ 91,
318
+ 426,
319
+ 343,
320
+ 9,
321
+ 1272,
322
+ 1210,
323
+ 1017,
324
+ 1080,
325
+ 1149,
326
+ 262,
327
+ 175
328
+ ],
329
+ "evaluation": {
330
+ "trajectory_count": 268,
331
+ "rmse_mpa": 3.2635509967803955,
332
+ "mae_mpa": 1.4564924240112305,
333
+ "r2": 0.999175488948822,
334
+ "state_point_count": 57388
335
+ }
336
+ }
337
+ }
338
+ },
339
+ "chaboche_combined": {
340
+ "held_out_family": "chaboche_combined",
341
+ "base_training": {
342
+ "steps": 1400,
343
+ "seconds": 41.68002520897426,
344
+ "best_validation_loss": 0.004121885751374066
345
+ },
346
+ "zero_shot": {
347
+ "trajectory_count": 269,
348
+ "rmse_mpa": 30.393577575683594,
349
+ "mae_mpa": 16.70126724243164,
350
+ "r2": 0.9328222870826721,
351
+ "state_point_count": 57629
352
+ },
353
+ "adaptation": {
354
+ "16": {
355
+ "training": {
356
+ "steps": 900,
357
+ "seconds": 21.83759491611272,
358
+ "best_validation_loss": 0.0010910335695371032
359
+ },
360
+ "selection": "path-family-balanced round-robin",
361
+ "training_trajectory_ids": [
362
+ 841,
363
+ 504,
364
+ 1777,
365
+ 1712,
366
+ 1521,
367
+ 1584,
368
+ 1648,
369
+ 760,
370
+ 672,
371
+ 588,
372
+ 925,
373
+ 842,
374
+ 505,
375
+ 1779,
376
+ 1715,
377
+ 1522
378
+ ],
379
+ "evaluation": {
380
+ "trajectory_count": 269,
381
+ "rmse_mpa": 20.846805572509766,
382
+ "mae_mpa": 10.1530122756958,
383
+ "r2": 0.9683961272239685,
384
+ "state_point_count": 57629
385
+ }
386
+ },
387
+ "64": {
388
+ "training": {
389
+ "steps": 1200,
390
+ "seconds": 34.28978379210457,
391
+ "best_validation_loss": 0.00030190416146069765
392
+ },
393
+ "selection": "path-family-balanced round-robin",
394
+ "training_trajectory_ids": [
395
+ 841,
396
+ 504,
397
+ 1777,
398
+ 1712,
399
+ 1521,
400
+ 1584,
401
+ 1648,
402
+ 760,
403
+ 672,
404
+ 588,
405
+ 925,
406
+ 842,
407
+ 505,
408
+ 1779,
409
+ 1715,
410
+ 1522,
411
+ 1585,
412
+ 1650,
413
+ 761,
414
+ 673,
415
+ 589,
416
+ 926,
417
+ 843,
418
+ 506,
419
+ 1781,
420
+ 1716,
421
+ 1525,
422
+ 1586,
423
+ 1653,
424
+ 764,
425
+ 675,
426
+ 590,
427
+ 928,
428
+ 846,
429
+ 508,
430
+ 1783,
431
+ 1717,
432
+ 1528,
433
+ 1588,
434
+ 1654,
435
+ 765,
436
+ 676,
437
+ 591,
438
+ 929,
439
+ 848,
440
+ 509,
441
+ 1784,
442
+ 1720,
443
+ 1529,
444
+ 1589,
445
+ 1655,
446
+ 767,
447
+ 677,
448
+ 592,
449
+ 931,
450
+ 849,
451
+ 511,
452
+ 1785,
453
+ 1722,
454
+ 1531,
455
+ 1591,
456
+ 1656,
457
+ 769,
458
+ 678
459
+ ],
460
+ "evaluation": {
461
+ "trajectory_count": 269,
462
+ "rmse_mpa": 8.491641998291016,
463
+ "mae_mpa": 4.113821983337402,
464
+ "r2": 0.9947562217712402,
465
+ "state_point_count": 57629
466
+ }
467
+ }
468
+ }
469
+ },
470
+ "hidden_three_memory_tabulated_hardening": {
471
+ "held_out_family": "hidden_three_memory_tabulated_hardening",
472
+ "base_training": {
473
+ "steps": 1400,
474
+ "seconds": 43.397430332843214,
475
+ "best_validation_loss": 0.0023462075041607022
476
+ },
477
+ "zero_shot": {
478
+ "trajectory_count": 232,
479
+ "rmse_mpa": 50.57877731323242,
480
+ "mae_mpa": 30.57018280029297,
481
+ "r2": 0.806849479675293,
482
+ "state_point_count": 59212
483
+ },
484
+ "adaptation": {
485
+ "16": {
486
+ "training": {
487
+ "steps": 900,
488
+ "seconds": 23.648075999924913,
489
+ "best_validation_loss": 0.00018563247112979298
490
+ },
491
+ "selection": "path-family-balanced round-robin",
492
+ "training_trajectory_ids": [
493
+ 2096,
494
+ 2080,
495
+ 2032,
496
+ 2048,
497
+ 2064,
498
+ 2097,
499
+ 2081,
500
+ 2033,
501
+ 2049,
502
+ 2065,
503
+ 2098,
504
+ 2082,
505
+ 2034,
506
+ 2050,
507
+ 2066,
508
+ 2099
509
+ ],
510
+ "evaluation": {
511
+ "trajectory_count": 232,
512
+ "rmse_mpa": 3.847371816635132,
513
+ "mae_mpa": 1.2943682670593262,
514
+ "r2": 0.9988824129104614,
515
+ "state_point_count": 59212
516
+ }
517
+ },
518
+ "64": {
519
+ "training": {
520
+ "steps": 1200,
521
+ "seconds": 34.54037875006907,
522
+ "best_validation_loss": 8.566799533582525e-05
523
+ },
524
+ "selection": "path-family-balanced round-robin",
525
+ "training_trajectory_ids": [
526
+ 2096,
527
+ 2080,
528
+ 2032,
529
+ 2048,
530
+ 2064,
531
+ 2097,
532
+ 2081,
533
+ 2033,
534
+ 2049,
535
+ 2065,
536
+ 2098,
537
+ 2082,
538
+ 2034,
539
+ 2050,
540
+ 2066,
541
+ 2099,
542
+ 2083,
543
+ 2035,
544
+ 2051,
545
+ 2067,
546
+ 2100,
547
+ 2084,
548
+ 2036,
549
+ 2052,
550
+ 2068,
551
+ 2101,
552
+ 2085,
553
+ 2037,
554
+ 2053,
555
+ 2069,
556
+ 2102,
557
+ 2086,
558
+ 2038,
559
+ 2054,
560
+ 2070,
561
+ 2103,
562
+ 2087,
563
+ 2039,
564
+ 2055,
565
+ 2071,
566
+ 2104,
567
+ 2088,
568
+ 2040,
569
+ 2056,
570
+ 2072,
571
+ 2105,
572
+ 2089,
573
+ 2041,
574
+ 2057,
575
+ 2073,
576
+ 2106,
577
+ 2090,
578
+ 2042,
579
+ 2058,
580
+ 2074,
581
+ 2107,
582
+ 2091,
583
+ 2043,
584
+ 2059,
585
+ 2075,
586
+ 2108,
587
+ 2092,
588
+ 2044,
589
+ 2060
590
+ ],
591
+ "evaluation": {
592
+ "trajectory_count": 232,
593
+ "rmse_mpa": 3.7123770713806152,
594
+ "mae_mpa": 1.1961064338684082,
595
+ "r2": 0.9989594221115112,
596
+ "state_point_count": 59212
597
+ }
598
+ }
599
+ }
600
+ }
601
+ },
602
+ "artifacts": {
603
+ "hidden_80_scratch": {
604
+ "path": "models/t2_denim_evidence_v3/hidden_80_scratch.safetensors",
605
+ "sha256": "b438ecbc97e5c63bf39a020a81858da6eabd13be00bc51336df544843558aba1"
606
+ },
607
+ "known_1154_plus_hidden_80": {
608
+ "path": "models/t2_denim_evidence_v3/known_1154_plus_hidden_80.safetensors",
609
+ "sha256": "cc21b64c3c9d2321cfabf261f1728e7811f114efbbdd4904ded124ee0b16abf2"
610
+ },
611
+ "lofo_j2_linear_isotropic_zero": {
612
+ "path": "models/t2_denim_evidence_v3/lofo_j2_linear_isotropic_zero.safetensors",
613
+ "sha256": "e5a2e66708b054002c0a13949d53022caa492c3d0d9b7d0400ce00a73e0d3d60"
614
+ },
615
+ "lofo_j2_linear_isotropic_16": {
616
+ "path": "models/t2_denim_evidence_v3/lofo_j2_linear_isotropic_16.safetensors",
617
+ "sha256": "2a597c038c7f1c794dc2ac0afceb06292786a9c14f694ea566f5eabaa9d4d491"
618
+ },
619
+ "lofo_j2_linear_isotropic_64": {
620
+ "path": "models/t2_denim_evidence_v3/lofo_j2_linear_isotropic_64.safetensors",
621
+ "sha256": "760b1429a631d6e53c53412086c73b9051fb19a03bddde350abfc90d0d4b1099"
622
+ },
623
+ "lofo_chaboche_combined_zero": {
624
+ "path": "models/t2_denim_evidence_v3/lofo_chaboche_combined_zero.safetensors",
625
+ "sha256": "d3fd0ed95602d76bb10ac7242485f39b0efe15c7c6792ce8f1f990694ec13427"
626
+ },
627
+ "lofo_chaboche_combined_16": {
628
+ "path": "models/t2_denim_evidence_v3/lofo_chaboche_combined_16.safetensors",
629
+ "sha256": "4afaa868bdeba09f87880f51487f7b396584b3dcf8666954ed4543e3fdd6fb15"
630
+ },
631
+ "lofo_chaboche_combined_64": {
632
+ "path": "models/t2_denim_evidence_v3/lofo_chaboche_combined_64.safetensors",
633
+ "sha256": "e1f3ef0b9371e11598135712e73a39da21a640fe7483efb8aa0f88553e3f63ab"
634
+ },
635
+ "lofo_hidden_three_memory_tabulated_hardening_zero": {
636
+ "path": "models/t2_denim_evidence_v3/lofo_hidden_three_memory_tabulated_hardening_zero.safetensors",
637
+ "sha256": "b0e6868b3d58ab1a8395ccc4754d563965f882bc106bc5fad44165310c68bf26"
638
+ },
639
+ "lofo_hidden_three_memory_tabulated_hardening_16": {
640
+ "path": "models/t2_denim_evidence_v3/lofo_hidden_three_memory_tabulated_hardening_16.safetensors",
641
+ "sha256": "af624369788d1372ac43041c8a5092f3db417eadb8bbb87283cec0fca2f9718f"
642
+ },
643
+ "lofo_hidden_three_memory_tabulated_hardening_64": {
644
+ "path": "models/t2_denim_evidence_v3/lofo_hidden_three_memory_tabulated_hardening_64.safetensors",
645
+ "sha256": "76106c05dbe5aeaa8579e2e765a3f12f744d8e4e050e6048783b093fab3e35e9"
646
+ }
647
+ },
648
+ "elapsed_seconds": 1603.7899112082087,
649
+ "lofo_refinement": {
650
+ "learning_rate": 0.0012,
651
+ "steps_16": 900,
652
+ "steps_64": 1200,
653
+ "reason": "balanced path-family coverage for fair few-shot boundary measurement"
654
+ },
655
+ "production_checkpoint_reference": {
656
+ "training": {
657
+ "reused": "t2_denim_conditional_v2/denim_conditional_v2_refined.pt"
658
+ },
659
+ "evaluation": {
660
+ "hidden_frozen_test": {
661
+ "trajectory_count": 32,
662
+ "rmse_mpa": 0.7980589270591736,
663
+ "mae_mpa": 0.39469894766807556,
664
+ "r2": 0.9999515414237976,
665
+ "state_point_count": 7712
666
+ },
667
+ "test_amplitude_ood": {
668
+ "trajectory_count": 60,
669
+ "rmse_mpa": 2.67646861076355,
670
+ "mae_mpa": 0.9395037889480591,
671
+ "r2": 0.9994901418685913,
672
+ "state_point_count": 14460
673
+ },
674
+ "test_discretization": {
675
+ "trajectory_count": 20,
676
+ "rmse_mpa": 0.9083492159843445,
677
+ "mae_mpa": 0.4616833031177521,
678
+ "r2": 0.9999374747276306,
679
+ "state_point_count": 8120
680
+ },
681
+ "test_long_horizon": {
682
+ "trajectory_count": 40,
683
+ "rmse_mpa": 4.262782096862793,
684
+ "mae_mpa": 1.5307230949401855,
685
+ "r2": 0.9986092448234558,
686
+ "state_point_count": 9640
687
+ },
688
+ "test_path_ood": {
689
+ "trajectory_count": 80,
690
+ "rmse_mpa": 0.782439112663269,
691
+ "mae_mpa": 0.39284950494766235,
692
+ "r2": 0.9999520778656006,
693
+ "state_point_count": 19280
694
+ }
695
+ }
696
+ },
697
+ "ablation_protocol": {
698
+ "steps": 1400,
699
+ "scratch_seed": 20260930,
700
+ "transfer_seed": 20260931,
701
+ "same_architecture_optimizer_and_validation_policy": true,
702
+ "production_checkpoint_reported_separately": true
703
+ }
704
+ }
article_evidence_v3/protocol.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "agentfem.denim-dataset-protocol.v3",
3
+ "data_are_additive": true,
4
+ "trajectory_total": 2660,
5
+ "frozen_protocol": {
6
+ "total_trajectories": 2660,
7
+ "train": 1484,
8
+ "validation": 407,
9
+ "test": 769,
10
+ "family_counts": {
11
+ "j2_linear_isotropic": {
12
+ "train": 577,
13
+ "validation": 171,
14
+ "test": 268
15
+ },
16
+ "chaboche_combined": {
17
+ "train": 577,
18
+ "validation": 170,
19
+ "test": 269
20
+ },
21
+ "hidden_three_memory_tabulated_hardening": {
22
+ "train": 330,
23
+ "validation": 66,
24
+ "test": 232
25
+ }
26
+ },
27
+ "selection_rule": "deterministic round-robin across path families; held-family training trajectories only"
28
+ },
29
+ "ablation_training_counts": [
30
+ 80,
31
+ 330,
32
+ 1234,
33
+ 1484
34
+ ],
35
+ "leave_one_family_out_adaptation_counts": [
36
+ 0,
37
+ 16,
38
+ 64
39
+ ],
40
+ "test_trajectories_never_used_for_optimization": true
41
+ }
article_evidence_v3/run_t2_denim_evidence_v3.py ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Run the frozen ablation and leave-one-family-out DENIM evidence matrix.
2
+
3
+ This script never optimizes on validation or test trajectories. It answers
4
+ two release questions: how much the 80/330 incomplete-family trajectories add,
5
+ and how a shared conditional closure behaves when one material family is
6
+ entirely unseen before 16/64-trajectory adaptation.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import copy
12
+ import hashlib
13
+ import json
14
+ import random
15
+ import time
16
+ from collections import defaultdict
17
+ from pathlib import Path
18
+
19
+ import numpy as np
20
+ import torch
21
+ from safetensors.torch import save_file
22
+
23
+ from src.t2_denim_conditional import ConditionalDENIM
24
+ from src.train_t2_denim_conditional_v2 import (
25
+ ARTIFACT_DIR as V2_ARTIFACT_DIR,
26
+ MODEL_DIR as V2_MODEL_DIR,
27
+ Trajectory,
28
+ _train_stage,
29
+ evaluate,
30
+ load_all_trajectories,
31
+ transitions,
32
+ )
33
+
34
+
35
+ ROOT = Path(__file__).resolve().parents[1]
36
+ OUTPUT = ROOT / "artifacts" / "t2_denim_evidence_v3"
37
+ MODELS = ROOT / "models" / "t2_denim_evidence_v3"
38
+ FAMILIES = (
39
+ "j2_linear_isotropic",
40
+ "chaboche_combined",
41
+ "hidden_three_memory_tabulated_hardening",
42
+ )
43
+
44
+
45
+ def _load(path: Path) -> ConditionalDENIM:
46
+ checkpoint = torch.load(path, map_location="cpu", weights_only=False)
47
+ model = ConditionalDENIM()
48
+ model.load_state_dict(checkpoint["state_dict"])
49
+ model.eval()
50
+ return model
51
+
52
+
53
+ def _save(model: ConditionalDENIM, name: str, metadata: dict[str, object]) -> dict[str, object]:
54
+ MODELS.mkdir(parents=True, exist_ok=True)
55
+ path = MODELS / f"{name}.safetensors"
56
+ save_file({key: value.detach().cpu().contiguous() for key, value in model.state_dict().items()}, path)
57
+ digest = hashlib.sha256(path.read_bytes()).hexdigest()
58
+ (MODELS / f"{name}.json").write_text(
59
+ json.dumps({**metadata, "sha256": digest}, indent=2) + "\n", encoding="utf-8"
60
+ )
61
+ return {"path": str(path.relative_to(ROOT)), "sha256": digest}
62
+
63
+
64
+ def _train(
65
+ initial: ConditionalDENIM | None,
66
+ train_groups: list[list[Trajectory]],
67
+ validation_groups: list[list[Trajectory]],
68
+ *,
69
+ steps: int,
70
+ seed: int,
71
+ ) -> tuple[ConditionalDENIM, dict[str, object]]:
72
+ torch.manual_seed(seed)
73
+ model = ConditionalDENIM() if initial is None else copy.deepcopy(initial)
74
+ history = _train_stage(
75
+ model,
76
+ [transitions(group) for group in train_groups],
77
+ [transitions(group) for group in validation_groups],
78
+ steps=steps,
79
+ seed=seed,
80
+ )
81
+ return model, {key: value for key, value in history.items() if key != "history"}
82
+
83
+
84
+ def _ids(trajectories: list[Trajectory], selected: list[Trajectory]) -> list[int]:
85
+ lookup = {id(value): index for index, value in enumerate(trajectories)}
86
+ return [lookup[id(value)] for value in selected]
87
+
88
+
89
+ def _hidden_protocols(trajectories: list[Trajectory]) -> dict[str, list[Trajectory]]:
90
+ groups: dict[str, list[Trajectory]] = defaultdict(list)
91
+ for item in trajectories:
92
+ if item.material == FAMILIES[2] and item.role == "test":
93
+ groups[item.evaluation].append(item)
94
+ return dict(groups)
95
+
96
+
97
+ def stratified_few_shot(values: list[Trajectory], count: int) -> list[Trajectory]:
98
+ """Select a deterministic path-family-balanced adaptation cohort."""
99
+
100
+ groups: dict[str, list[Trajectory]] = defaultdict(list)
101
+ for item in values:
102
+ groups[item.family].append(item)
103
+ selected: list[Trajectory] = []
104
+ depth = 0
105
+ names = sorted(groups)
106
+ while len(selected) < count:
107
+ changed = False
108
+ for name in names:
109
+ if depth < len(groups[name]) and len(selected) < count:
110
+ selected.append(groups[name][depth])
111
+ changed = True
112
+ if not changed:
113
+ break
114
+ depth += 1
115
+ if len(selected) != count:
116
+ raise RuntimeError(f"Cannot select {count} stratified trajectories from {len(values)}.")
117
+ return selected
118
+
119
+
120
+ def _evaluate_hidden(model: ConditionalDENIM, groups: dict[str, list[Trajectory]]) -> dict[str, object]:
121
+ return {name: evaluate(model, group) for name, group in sorted(groups.items())}
122
+
123
+
124
+ def run(*, steps: int = 1400, adaptation_steps: int = 900) -> dict[str, object]:
125
+ random.seed(20260925)
126
+ np.random.seed(20260925)
127
+ torch.manual_seed(20260925)
128
+ trajectories = load_all_trajectories()
129
+ train = {family: [x for x in trajectories if x.material == family and x.role == "train"] for family in FAMILIES}
130
+ validation = {family: [x for x in trajectories if x.material == family and x.role == "validation"] for family in FAMILIES}
131
+ test = {family: [x for x in trajectories if x.material == family and x.role == "test"] for family in FAMILIES}
132
+ hidden_groups = _hidden_protocols(trajectories)
133
+ closure80 = [x for x in train[FAMILIES[2]] if x.source == "denim_closure_v1"]
134
+ if len(closure80) != 80 or len(train[FAMILIES[2]]) != 330:
135
+ raise RuntimeError("Frozen hidden-family training cohorts changed.")
136
+
137
+ started = time.perf_counter()
138
+ records: dict[str, object] = {}
139
+ artifacts: dict[str, object] = {}
140
+
141
+ pretrained = _load(V2_MODEL_DIR / "denim_conditional_pretrained.pt")
142
+ full = _load(V2_MODEL_DIR / "denim_conditional_v2_refined.pt")
143
+ scratch330 = _load(V2_MODEL_DIR / "denim_conditional_scratch.pt")
144
+
145
+ scratch80, training = _train(
146
+ None, [closure80], [validation[FAMILIES[2]]], steps=steps, seed=20260930
147
+ )
148
+ records["hidden_80_scratch"] = {
149
+ "training": training,
150
+ "evaluation": _evaluate_hidden(scratch80, hidden_groups),
151
+ }
152
+ artifacts["hidden_80_scratch"] = _save(
153
+ scratch80, "hidden_80_scratch", {"training_trajectory_ids": _ids(trajectories, closure80)}
154
+ )
155
+
156
+ records["hidden_330_scratch"] = {
157
+ "training": {"reused": "t2_denim_conditional_v2/denim_conditional_scratch.pt"},
158
+ "evaluation": _evaluate_hidden(scratch330, hidden_groups),
159
+ }
160
+
161
+ transfer80, training = _train(
162
+ pretrained,
163
+ [train[FAMILIES[0]] + train[FAMILIES[1]], closure80],
164
+ [validation[FAMILIES[0]] + validation[FAMILIES[1]], validation[FAMILIES[2]]],
165
+ steps=steps,
166
+ seed=20260931,
167
+ )
168
+ records["known_1154_plus_hidden_80"] = {
169
+ "training": training,
170
+ "evaluation": _evaluate_hidden(transfer80, hidden_groups),
171
+ }
172
+ artifacts["known_1154_plus_hidden_80"] = _save(
173
+ transfer80,
174
+ "known_1154_plus_hidden_80",
175
+ {"hidden_training_trajectory_ids": _ids(trajectories, closure80)},
176
+ )
177
+ records["known_1154_plus_hidden_330"] = {
178
+ "training": {"reused": "t2_denim_conditional_v2/denim_conditional_v2_refined.pt"},
179
+ "evaluation": _evaluate_hidden(full, hidden_groups),
180
+ }
181
+
182
+ lofo: dict[str, object] = {}
183
+ for target_index, target in enumerate(FAMILIES):
184
+ others = [family for family in FAMILIES if family != target]
185
+ base, base_training = _train(
186
+ None,
187
+ [train[family] for family in others],
188
+ [validation[family] for family in others],
189
+ steps=steps,
190
+ seed=20261010 + target_index,
191
+ )
192
+ family_record: dict[str, object] = {
193
+ "held_out_family": target,
194
+ "base_training": base_training,
195
+ "zero_shot": evaluate(base, test[target]),
196
+ "adaptation": {},
197
+ }
198
+ artifacts[f"lofo_{target}_zero"] = _save(
199
+ base,
200
+ f"lofo_{target}_zero",
201
+ {"held_out_family": target, "adaptation_trajectories": 0},
202
+ )
203
+ for count in (16, 64):
204
+ selected = stratified_few_shot(train[target], count)
205
+ adapted, adaptation = _train(
206
+ base,
207
+ [sum((train[family] for family in others), []), selected],
208
+ [sum((validation[family] for family in others), []), validation[target]],
209
+ steps=adaptation_steps,
210
+ seed=20261100 + 10 * target_index + count,
211
+ )
212
+ family_record["adaptation"][str(count)] = {
213
+ "training": adaptation,
214
+ "training_trajectory_ids": _ids(trajectories, selected),
215
+ "evaluation": evaluate(adapted, test[target]),
216
+ }
217
+ artifacts[f"lofo_{target}_{count}"] = _save(
218
+ adapted,
219
+ f"lofo_{target}_{count}",
220
+ {
221
+ "held_out_family": target,
222
+ "adaptation_trajectories": count,
223
+ "training_trajectory_ids": _ids(trajectories, selected),
224
+ },
225
+ )
226
+ lofo[target] = family_record
227
+ print(json.dumps({"completed_lofo": target, "metrics": family_record}, indent=2), flush=True)
228
+
229
+ result = {
230
+ "schema": "agentfem.denim-evidence.v3",
231
+ "frozen_protocol": {
232
+ "total_trajectories": len(trajectories),
233
+ "train": sum(len(values) for values in train.values()),
234
+ "validation": sum(len(values) for values in validation.values()),
235
+ "test": sum(len(values) for values in test.values()),
236
+ "family_counts": {
237
+ family: {"train": len(train[family]), "validation": len(validation[family]), "test": len(test[family])}
238
+ for family in FAMILIES
239
+ },
240
+ "selection_rule": "deterministic round-robin across path families; held-family training trajectories only",
241
+ },
242
+ "ablation": records,
243
+ "leave_one_family_out": lofo,
244
+ "artifacts": artifacts,
245
+ "elapsed_seconds": time.perf_counter() - started,
246
+ }
247
+ OUTPUT.mkdir(parents=True, exist_ok=True)
248
+ (OUTPUT / "evidence_metrics.json").write_text(
249
+ json.dumps(result, indent=2) + "\n", encoding="utf-8"
250
+ )
251
+ print(json.dumps({"elapsed_seconds": result["elapsed_seconds"], "output": str(OUTPUT)}, indent=2))
252
+ return result
253
+
254
+
255
+ if __name__ == "__main__":
256
+ run()