UNQ_C6 AssertionError:

Hello,

I’m currently working on UNQ_C6 and I’m currently getting this error

Here’s the algorithm I’m using :

  1. Using the get_noise() function attached to the device with rows, and columns needed to create a NoisyVectors.
  2. Getting the fakeimages through a detached gen using the NoisyVectors.
  3. Calculating the FakeImages loss by using the criterion of disc results of fake images compared to a matrix of 0’s and storing it to LossFake
  4. Calculating the RealImages loss by using the criterion of disc results of real images compared to a matrix of 1’s and storing it to LossReal
  5. Calculate the disc_loss by passing the LossFake, and LossReal results to criterion .

Have any suggestions?

It all sounds reasonable up until step 5. Once you have LossFake and LossReal, I thought that disc_loss is just the average of the two, isn’t it? You’ve already invoked criterion twice and don’t need it for the final step.

1 Like

Ah, that makes sense. I see now that it says to take the average/mean in the comments. I must have overlooked that.

I fixed my code and tweaked a few things and it runs like a charm now.
Thank you for the quick response! :pray:

That’s excellent! Thanks for confirming. There is plenty more interesting material ahead. Onward! :nerd_face: