UNQ_C4 seems simple, but can’t interpret the AssertionError with no details:
Applying torch.mean to fake_features_all, the result is assigned to mu_fake.
Applying torch.mean to real_features_all, that result is assigned to mu_real.
Earlier defined function get_covariance
is applied to mu_fake and the result is assigned to sigma_fake. The same function is applied to mu_real and the result is assigned to sigma_real.
I’ve tried a number of parameters in the PyTorch mean function thinking about the shape of the Tensor get_covariance gets, but nothing resolved the AssertionError.
Hi Jswatdlai!
Hope you are doing well.
Please read the instructions in the cell, carefully.
Calculate the covariance matrix for the fake and real features and also calculate the means of the feature over the batch (for each feature dimension mean)
. When you want to calculate the covariance matrix for the fake and real features, why are you calculating the covariance matrix of mu_fake and mu_real? Think over it.
Regards,
Nithin
Hi and thanks, Nithin.
I did repeatedly, over time misread the instructions, sorry for that.
As no combination of torch.mean and various feature variables and no combination of get_covariance and various features (‘plain’ or _all) are passing the assertion tests, I’m at a loss for what to do next.
I may have damaged global variables so have renamed my previous effort, then loaded the latest notebook with the correct notebook name. Entering the code that worked up to UNQ_C4 is fine but still no passing the assertions.
I have applied torch.mean to fake_features and placed that in mu_fake BUT the last arrow in the AssertionError processing points to mu_fake.shape == fake_features_all.shape which doesn’t make sense:
because mu_fake’s values is based on fake_features, not fake_features_all.
Thanks for further suggestions.
No, again pls look at it carefully → it points to mu_fake.shape == (fake_features_all.shape[1],) not fake_features_all.shape
Also, notice that you have to the means of the feature over the batch (for each feature dimension mean)
not simply passing the fake_features_all or real_features_all to torch.mean() , there are few other parameters in mean() function, pls make use of them to get the desired output.
Regards,
Nithin
Believe it or not, Tuesday is when I started working on this AssertionError problem. Tuesday and yesterday I was working with the parameters of torch.mean() but had no luck.
Question: Given the results of batch processing are appended to a list and then concatenated into _features_all into a sequence of tensors in code cell 15, how do I calculate the means for each batch? Also, is each batch mean supposed to be a scalar?
I cannot give you direct answers, but one more clue: check out the dim
parameter of mean() method of torch class.
1 Like
I adjusted the torch.mean dim and keepdims parameters and am now to the 8th AssertionError–I think that’s progress:
but, I’m not sure what that AssertionError of _fakes minus some value being < 0.05 means.
I seem to be 1 step from “Success!”, though.
Wished I was better at this =)
Well, figured out enough to get to “Success!”
Thanks for the emails and take care!
1 Like