(self, val, n=1)
| 17 | self.count = 0 |
| 18 | |
| 19 | def update(self, val, n=1): |
| 20 | self.val = val |
| 21 | self.sum += val * n |
| 22 | self.count += n |
| 23 | self.avg = self.sum / self.count |
| 24 | |
| 25 | def accuracy(output, target, topk=(1,)): |
| 26 | """Computes the accuracy over the k top predictions for the specified values of k""" |
no outgoing calls
no test coverage detected