I’m at my wits’ end with InjectNoise. I just can’t pass the unit test so I’m hoping for help here.

It seems very easy - I know what the noise shape should be (the hint tells you) so I’m using that shape as an argument to torch.randn() which is passed in as an agument to nn.Parameter in the init function.

Then in the forward function the shape should be (1,1,r,c) where r and c are the image row and column sizes (both equal to 10 in the unit test) which I get from image.shape. The instructions say to generate a single channel of noise so this shape seems right. At any rate, I’ve tried all sensible combinations of other values from the image shape with no success.

However, I can’t pass line 15 in the unit test because I’m getting a small value for the mean std over channel 0 instead of a value > 1e-4.

Any help is appreciated. Thanks in advance!