(self, epoch)
| 73 | self.writer.display_terminal(self.len_epoch, epoch, mode='train', summary=True) |
| 74 | |
| 75 | def validate_epoch(self, epoch): |
| 76 | self.model.eval() |
| 77 | |
| 78 | for batch_idx, input_tuple in enumerate(self.valid_data_loader): |
| 79 | with torch.no_grad(): |
| 80 | input_tensor, target = prepare_input(input_tuple=input_tuple, args=self.args) |
| 81 | input_tensor.requires_grad = False |
| 82 | |
| 83 | output = self.model(input_tensor) |
| 84 | loss, per_ch_score = self.criterion(output, target) |
| 85 | |
| 86 | self.writer.update_scores(batch_idx, loss.item(), per_ch_score, 'val', |
| 87 | epoch * self.len_epoch + batch_idx) |
| 88 | |
| 89 | self.writer.display_terminal(len(self.valid_data_loader), epoch, mode='val', summary=True) |
no test coverage detected