NDT2Pretrain#
- class pretrain.models.NDT2Pretrain(cfg, rank, world_size)[source]#
Bases:
core.trainer.BaseTrainerMasked spike modelling for NDT2, which masks context tokens and accumulates gradients.
- setup(ckpt)[source]#
Set up the trainer.
This method is called after setting up distributed, loading the checkpoint, and setting up logging.
- val_epoch()[source]#
Perform a validation epoch.
Called every val.every_n_epochs epochs, and at the end of training.
- Returns:
bool, True if early stopping should be triggered, False (or falsey) otherwise.
- Return type:
early_stop