MtMEvalTrainer#
- class ts2.models.pretrained.MtMEvalTrainer(cfg, rank, world_size)[source]#
Bases:
ts2.ts2_eval_trainer.TS2EvalTrainerTS2 trainer for MtM, prompting the forward with the task’s mask-mode token.
Training corrupts the input with the configured masker and scores the loss on the corrupted entries; inference always prompts with
TASK_MASK_MODE[task].- predict(X, mask=None, mask_timestamps=None, mask_units=None)[source]#
Generate model predictions for a batch.
Override this if the model requires masking information at inference time (e.g. for masked autoencoder models).
- Parameters:
X – Input batch dict containing
model_inputs.mask – Optional boolean mask for masked prediction.
mask_timestamps – Optional timestamps for masked positions.
mask_units – Optional unit indices for masked positions.
- Returns:
Model output predictions.
- Return type:
- setup_model(ckpt=None)[source]#
Instantiate and register the model.
Instantiates the model from the Hydra config and registers it for checkpointing. Override this to load pretrained weights or modify the model architecture.
- link_model(model, ckpt)[source]#
Link datasets to the model.
Attaches the configured transforms and the model input_fn to the train/val/test dataset transform pipelines, then calls
model.link_datasetsto register the datasets with the model.