Model training loop phase. Each model's training loop iteration could be separated into (at least) two phases: training and validation. The instances of this class track metrics and counters, related to the specific phase, and keep the reference to subset of data, used during p
| 3 | # from permuto_sdf_py.callbacks.scores import * |
| 4 | |
| 5 | class Phase: |
| 6 | """ |
| 7 | Model training loop phase. |
| 8 | |
| 9 | Each model's training loop iteration could be separated into (at least) two |
| 10 | phases: training and validation. The instances of this class track |
| 11 | metrics and counters, related to the specific phase, and keep the reference |
| 12 | to subset of data, used during phase. |
| 13 | """ |
| 14 | |
| 15 | def __init__(self, name, loader, grad): |
| 16 | self.name = name |
| 17 | self.loader = loader |
| 18 | self.grad = grad |
| 19 | self.iter_nr = 0 |
| 20 | self.epoch_nr = 0 |
| 21 | self.samples_processed_this_epoch = 0 |
| 22 | # self.scores= Scores() |
| 23 | self.loss_acum_per_epoch=0.0 |
| 24 | self.loss_pos_acum_per_epoch=0.0 |
| 25 | self.loss_dir_acum_per_epoch=0.0 |
| 26 |