docs: freeze B1 residual contract and exact learning clock weights for review
This commit is contained in:
1 parent
7cb1f1c146
commit
e751e5b261
10 files changed
+39097
-12
No files matched your search
@@ -6,6 +6,25 @@ in the reviewed contract. Passing F explicitly avoids a hidden extra feature.
|
||||
import numpy as np
|
||||
|
||||
|
||||
def learning_clock(end_ratios, component_ids):
|
||||
"""Mean over components of mean retained-tet-end/t_set per learning part.
|
||||
|
||||
For the random v4 protocol each part can be its own unit, if the final
|
||||
specification chooses part weighting. Caller enforces training roles.
|
||||
"""
|
||||
ratios = np.asarray(end_ratios, dtype=np.float64)
|
||||
if ratios.ndim != 1 or not len(ratios) or len(component_ids) != len(ratios):
|
||||
raise ValueError('Clock row count mismatch')
|
||||
if not np.isfinite(ratios).all() or np.any(ratios <= 0):
|
||||
raise ValueError('Invalid retained-tet endpoint ratio')
|
||||
groups = {}
|
||||
for group, ratio in zip(component_ids, ratios):
|
||||
if not isinstance(group, str) or not group:
|
||||
raise ValueError('Missing clock group identity')
|
||||
groups.setdefault(group, []).append(float(ratio))
|
||||
return float(np.mean([np.mean(v) for v in groups.values()]))
|
||||
|
||||
|
||||
def prior(cdf, clock):
|
||||
f = np.asarray(cdf)
|
||||
if f.ndim != 1 or f.dtype.kind != 'f' or not len(f):
|
||||
|
||||
Reference in new issue
Block a user