Fastai v2 vision

FYI, I made this in the end:

class RandNoisyTransform(Transform):
    order = 100 # After Normalize
    def __init__(self, noise_factor = 0.5):
        self.noise_factor = noise_factor

    def __call__(self, b, **kwargs):
        x,y = b
        return x + self.noise_factor * torch.randn(x.shape), y
7 Likes