Thanks for the reply! I’m sorry I didn’t paste the error, I forgot it… my bad.
The torch x before passing it through the loss function: [0.5729, 0.5729, 0.5729,  …, 0.5160, 0.5266, 0.5555] (min 0, max 1)
The error:
all elements of input should be between 0 and 1
However, z (input for binary_cross_entropy) looks like that: [-0.9888,  0.1598,  1.3676,  …,  1.4632, -2.4632,  2.5672]  (min -4.68, max 5.9)
which is causing the error.
If I understood you correctly, both target and input should be either 0 and 1, which means that my data is not correctly transformed for that function? If so, is there a better loss function to use, since audio data is pretty hard to transform to only 0 and 1 while keeping the data loss to a minimum? That would also explain why it worked well on the mnist data, because that’s easy to transform to only 0 and 1 I guess.