Source code for mighty.trainer.test

from .trainer import Trainer


__all__ = [
    "Test"
]


[docs] class Test(Trainer): """ A Test trainer that only evaluates a model. """
[docs] def train_epoch(self, epoch): self.timer.batch_id += self.timer.batches_in_epoch
[docs] def train_batch(self, batch): outputs = self._forward(batch) loss = self._get_loss(batch, outputs) return loss