Remove legacy event and mixed distribution paths
This commit is contained in:
38
eval_data.py
38
eval_data.py
@@ -151,6 +151,33 @@ def build_model_from_dataset(
|
||||
f"{model_target_mode!r}"
|
||||
)
|
||||
model_architecture = resolve_model_architecture(cfg, state_dict)
|
||||
continuous_value_center = None
|
||||
continuous_value_scale = None
|
||||
if dataset.n_cont_types > 0:
|
||||
scaling = str(cfg.get("continuous_value_scaling", "")).lower()
|
||||
if scaling != "robust":
|
||||
raise RuntimeError(
|
||||
"Continuous-variable checkpoints must declare "
|
||||
"continuous_value_scaling='robust'; unscaled checkpoints are "
|
||||
"not supported"
|
||||
)
|
||||
if state_dict is None:
|
||||
raise RuntimeError(
|
||||
"A checkpoint state_dict is required to restore RobustScale buffers"
|
||||
)
|
||||
center_key = "tokenizer.continuous_value_center"
|
||||
scale_key = "tokenizer.continuous_value_scale"
|
||||
missing = [
|
||||
key for key in (center_key, scale_key)
|
||||
if key not in state_dict
|
||||
]
|
||||
if missing:
|
||||
raise RuntimeError(
|
||||
"Checkpoint is missing required RobustScale buffers: "
|
||||
+ ", ".join(missing)
|
||||
)
|
||||
continuous_value_center = state_dict[center_key]
|
||||
continuous_value_scale = state_dict[scale_key]
|
||||
return DeepHealth(
|
||||
vocab_size=dataset.vocab_size,
|
||||
n_embd=int(cfg_get(args, cfg, "n_embd", 120)),
|
||||
@@ -161,9 +188,8 @@ def build_model_from_dataset(
|
||||
n_categories=dataset.n_categories,
|
||||
cont_type_ids=dataset.cont_type_ids,
|
||||
n_bins=int(cfg_get(args, cfg, "n_bins", 16)),
|
||||
continuous_value_scaling=str(
|
||||
cfg_get(args, cfg, "continuous_value_scaling", "none")
|
||||
),
|
||||
continuous_value_center=continuous_value_center,
|
||||
continuous_value_scale=continuous_value_scale,
|
||||
extra_pool_reduce=str(
|
||||
cfg_get(args, cfg, "extra_pool_reduce", "mean")
|
||||
),
|
||||
@@ -251,9 +277,9 @@ class AllFutureSequenceEvalDataset:
|
||||
Eval-only sequence view for all-future checkpoints.
|
||||
|
||||
All-future training uses the observed history without reusing the
|
||||
next-step view that contains imputed <NO_EVENT> gap tokens. CHECKUP is
|
||||
retained only when the experiment selects at least one extra-info type;
|
||||
an explicitly empty selection is a disease-only history.
|
||||
next-step view that contains imputed <NO_EVENT> gap tokens. Legacy label-1
|
||||
assessment events are removed by the shared base dataset for every
|
||||
extra-info selection.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
||||
Reference in New Issue
Block a user