Commit 1e5c4b3
committed
boxcrete: V2 strength GP — final-form module layout
Introduces the V2 strength GP — a multiplicatively-gated kernel architecture
that structurally enforces the physics constraint f(x, t=0) = 0 with zero
posterior variance — plus the supporting public API and the saved model
artifact.
Module layout (each module focused on one concept):
* boxcrete/concrete_model.py — SustainableConcreteModel (the
multi-output joint GWP/slump/strength model) and AppendDerivedFeatures.
* boxcrete/strength_model.py — public fit/load API for V2:
fit_strength_gp() and load_pretrained_strength_gp(). Hosts the
V2 fit factory and ChainedInputTransform composition.
* boxcrete/kernels.py — kernel primitives: TimeGatedKernel,
within_group_prior, ard_matern_with_within_group_prior,
additive_time_kernel, build_strength_kernel_for_aug_dim,
make_gated_strength_kernel_builder.
* boxcrete/features.py — features and transforms:
F5_ALLLOG_FEATURES, GATE_TAU, IDX, FEATURE_BUILDERS,
append_engineered_features_callable, augmented_bounds, max_scale_Y,
LearnableLogTimeTransform.
* boxcrete/likelihoods.py — GatedGaussianLikelihood (heteroscedastic
Gaussian with h(t)² gating, paired with the gated kernel) and
PartialFixedNoiseLikelihood.
* boxcrete/priors.py — WithinGroupShrinkagePrior + the binder /
aggregate group definitions used for ARD lengthscale shrinkage.
* boxcrete/slump_model.py — fit_slump_gp() for the slump model.
* boxcrete/strength_model_legacy.py — V1 helpers retained for
backward compatibility (get_strength_gp_input_transform).
Replaces the legacy boxcrete/models.py (758 lines) with the focused
modules above.
Persisted artifact:
* docs/model/strength_model.pt — PyTorch state_dict for the deployed
V2 strength GP. load_pretrained_strength_gp() reconstructs the
full SingleTaskGP from this without re-fitting.
Tests:
* test/test_strength_model_parity.py — guards that the V2 fit
factory produces byte-equivalent posteriors to the research-side
catalog at experiments/model_variant_study.py.
* test/test_pretrained_loader_fidelity.py — guards that the
state_dict round-trip reproduces the trained model exactly.
* test/test_strength_curve_monotonicity.py — physical-constraint
regression for monotonic strength evolution.
* test/test_physical_constraints.py — physical-constraint regression
for f(x, t=0) = 0 with zero variance under the gated kernel.
* test/test_public_api.py — public API surface guard.1 parent 348b0ac commit 1e5c4b3
30 files changed
Lines changed: 4787 additions & 2788 deletions
File tree
- boxcrete
- docs/model
- notebooks
- scripts
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
16 | 25 | | |
| 26 | + | |
| 27 | + | |
17 | 28 | | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
23 | 38 | | |
24 | 39 | | |
25 | 40 | | |
| |||
69 | 84 | | |
70 | 85 | | |
71 | 86 | | |
| 87 | + | |
| 88 | + | |
72 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
73 | 94 | | |
74 | 95 | | |
75 | 96 | | |
| |||
80 | 101 | | |
81 | 102 | | |
82 | 103 | | |
| 104 | + | |
83 | 105 | | |
84 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
85 | 112 | | |
86 | 113 | | |
87 | 114 | | |
| |||
93 | 120 | | |
94 | 121 | | |
95 | 122 | | |
| 123 | + | |
| 124 | + | |
96 | 125 | | |
| 126 | + | |
97 | 127 | | |
98 | 128 | | |
99 | 129 | | |
100 | 130 | | |
101 | 131 | | |
102 | 132 | | |
103 | 133 | | |
| 134 | + | |
104 | 135 | | |
0 commit comments