(self, val, n=1)
| 170 | self.count = 0 |
| 171 | |
| 172 | def update(self, val, n=1): |
| 173 | self.val = val |
| 174 | self.sum += val * n |
| 175 | self.count += n |
| 176 | self.avg = self.sum / self.count |
| 177 | |
| 178 | from torchvision import transforms |
| 179 | def image_transform(image, resolution=256, normalize=True): |