Training issues

Hi, I tend to learn a model that can map X=[400,100] to y=[400,180], in which each row of y has just one non-zero element = 1. A model with binary cross-entropy loss and adam optimizer could map that, but when I replace y by y=0.5*y, the model does not train at all and just returns a zero output (output=> zeros([400,180]) ).
Could you mind helping me fix this problem?

If I understand your use case correctly, you are struggling with getting good performance out of your model using soft labels and in particular if the target is set to 0.5? If so, have a look at this post which shows that the cost of binary crossentropy is non-zero for this use case.

hi @ptrblck thanks for your reply… As I understand from the post you mentioned, Binary cross-entropy is not good for my problem. As one of the replies suggested I changed the loss function to categorical_crossentropy and the activation function to sigmoid, it does not work either.(it distinguishes the place of the nonzero element, But with the wrong magnitude(0.98 instead of 0.5)) Could you mind helping me with how to fix it?
The aim of the model is to find out that the magnitude of the non-zero element in each output (each row of y ) which in this case is 0.5 and should find the place of the non-zero element. I used the MSE but in the best case, it find the magnitude as 0.1 instead of 0.5.

I don’t know what the best approach would be and would have assumed that nn.MSELoss should work, so let’s wait for the experts in this topic.