MtMEvalTrainer#
- class ts1.models.pretrained.MtMEvalTrainer(cfg, rank, world_size)[source]#
Bases:
ts1.ts1_eval_trainer.TS1EvalTrainerTS1 trainer for MtM, prompting the forward with an optional mask-mode token.
Pretraining always prompts with the mode that produced the input, but TS1 decodes uncorrupted input, so the mode is a config choice:
cfg.mask_modenames one, ornullleaves the sequence unprompted. See prds/ts1-mtm-trainer.md.- setup_model(ckpt)[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.
- predict(X, target_timestamps=None, target_mask=None)[source]#
Generate model predictions for a batch.
Override this if the model requires target timestamps or mask at inference time (e.g. for masked prediction models).
- Parameters:
X – Input batch dict containing
model_inputs.target_timestamps – Optional target timestamps tensor.
target_mask – Optional boolean mask tensor for the targets.
- Returns:
Model output predictions.
- Return type: