| 59 | self.epoch_accuracy = self.epoch_accuracy |
| 60 | |
| 61 | def update(self, idx, train_loss, train_acc, val_loss, val_acc): |
| 62 | assert idx >= 0 and idx < self.total_epoch, 'total_epoch : {} , but update with the {} index'.format( |
| 63 | self.total_epoch, idx) |
| 64 | self.epoch_losses[idx, 0] = train_loss |
| 65 | self.epoch_losses[idx, 1] = val_loss |
| 66 | self.epoch_accuracy[idx, 0] = train_acc |
| 67 | self.epoch_accuracy[idx, 1] = val_acc |
| 68 | self.current_epoch = idx + 1 |
| 69 | # return self.max_accuracy(False) == val_acc |
| 70 | |
| 71 | def max_accuracy(self, istrain): |
| 72 | if self.current_epoch <= 0: return 0 |