(self, val, n=1)
| 71 | self.losses = [] |
| 72 | |
| 73 | def update(self, val, n=1): |
| 74 | self.val = val |
| 75 | self.sum += val * n |
| 76 | self.count += n |
| 77 | self.avg = self.sum / self.count |
| 78 | self.losses.append(val) |
| 79 | |
| 80 | def show(self): |
| 81 | return torch.mean(torch.stack(self.losses[np.maximum(len(self.losses)-self.num, 0):])) |
nothing calls this directly
no outgoing calls
no test coverage detected