| 47 | self.reset(total_epoch) |
| 48 | |
| 49 | def reset(self, total_epoch): |
| 50 | assert total_epoch > 0 |
| 51 | self.total_epoch = total_epoch |
| 52 | self.current_epoch = 0 |
| 53 | self.epoch_losses = np.zeros((self.total_epoch, 2), |
| 54 | dtype=np.float32) # [epoch, train/val] |
| 55 | self.epoch_losses = self.epoch_losses - 1 |
| 56 | |
| 57 | self.epoch_accuracy = np.zeros((self.total_epoch, 2), |
| 58 | dtype=np.float32) # [epoch, train/val] |
| 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( |