is there possibly an error for the noise insertion section of the style gan components assignment. I in one section of the grader all of the checks are greater than except one.
It’s been a while since I looked at this assignment, but I think the point is that not all 4 of the dimensions are handled the same way there. Look at how dimension 1 is treated in noise injection: the size of that dimension is 1, but the other dimensions are all non-trivial. What effect will that have in the resulting behavior?
Yes, that’s the way I did it. Mind you, I worked this assignment > 2 years ago, so I don’t know if they’ve subsequently updated the assignment in any way.
I just got the latest version of the notebook and there is only one minor change since 2 years ago in the template code that they provide. So I think that weight initialization should still be correct.
ok, thanks again. There are only two coding blocks in this section so I have no clue what I could be missing. Using the image shape as the noise shape.
Note that the noise shape is not the same as the image shape, right? That was what I was referring to earlier about why the test for dimension 1 is different. Oh, ok, that was part of the code you need to write, so that is probably where your bug is. The shape of the noise is the same as the shape of the image in every dimension except dimension 1. Dimension 1 has only 1 element for noise.
I used the above function for the weights.
I also indexed the dimensions 1-3 of the input image, following 1 for the n_samples.
The preceding checks are fine.
I have also restarted the kernel.
However it fails at the first assert of the block:
assert torch.abs((inject_noise(fake_images) - fake_images).std(0)).mean() > 1e-4
Sorry you are absolutely right. Thanks. The channels should be set to 1 for the noise, so that each channel is calculated differently, as people have said. The multiplication of the noise vector and the weights should be of the same size as the image. This was in the instructions, which make it very clear that this is what we are doing.
Haha, it’s funny that everyone gets stuck on the same things! So useful to read older posts! Saves a lot of debugging time and sifting through print statements.