Close custody main-review checks for named B0 units and coordinate scaling

This commit is contained in:
Frank14f committed 2026-11-15 16:12:22 +08:00
1 parent 6e4d991d78
commit 522ee84f6a
7 files changed
+233 -7

No files matched your search

+6 -2
View File
@@ -8,6 +8,8 @@ import numpy as np
from s2_custody_common import contract,checked,test_rows,prediction_inputs,expected_models,prediction_path
from s2_recovery_supervisor import save
from freeze_g1_components import sha
from s2_models.features import R2_COLUMNS
from s2_models.objectives import b0_seconds
def load_neural(m,device):
@@ -50,8 +52,10 @@ def run(root,fold):
with torch.inference_mode(),torch.autocast('cuda',enabled=False):
y=loaded[m['name']](tensors['base'],tensors['ids'],tensors['gaps'],tensors['edge'] if m['arm']=='E' else None).cpu().numpy().astype(np.float64)
elif m['kind']=='R2':y=loaded[m['name']].predict(d['x'])
else:y=d['x'][:,0].copy()
seconds=y*d['t_set']
else:
assert R2_COLUMNS[0]=='Vf'
y=d['x'][:,R2_COLUMNS.index('Vf')].copy()
seconds=b0_seconds(y,d['t_set']) if m['kind']=='B0' else y*d['t_set']
if seconds.shape!=d['ids'].shape or not np.isfinite(seconds).all():raise ValueError('Invalid prediction '+m['name'])
p=prediction_path(root,m,row['case']);p.parent.mkdir(parents=True,exist_ok=True)
if p.exists():raise FileExistsError('No prediction overwrite/retry')