Hi @MarcosMM,
I haven’t dug into this one, but try the debugging technique I suggested for your previous question about get_disc_loss - looking at what the unit test is expecting and comparing that with your results to see if you can figure this one out on your own.
If you’re still stuck after trying that, write back here and share what error message you’re getting from the unit tests and I’ll take a closer look at the values you shared to see if I notice any hints about what might be wrong.
I took your advice and tried to debug my results again. The fact is that my values were correct, but I noticed that the adversarial loss results were floats instead of ints. If I sum the tensora extracting their values with ‘item()’, the resulting sum is the expected value.
Also, I saw this post, but I didn’t like the idea of casting anything…
My ‘bug’ was that in the adversarial loss function I was defining the labels like torch.ones(tensor_X.shape) instead of using torch.ones_like(tensor_X), whis solves the ‘typing’ issue here. Now it works and the model trains. Silly mistake, but it was breaking my head…
Hi. Thanks. Faced a similar issue. This helped me resolve it. I am curious though, why does torch.ones(disc_pred.shape) and torch.ones_like(disc_pred) result in quite different results? Thanks again.