its the BCE output, I have used the following within the class model, (which i assume is applying a sigmoid function):
    def decode(self, z2,apply_sigmoid=True):
        logits=self.Decoder(z2)
        if apply_sigmoid:
            probs = torch.sigmoid(logits)
            return probs
    
        return logits

“z2” is the input into the decoder, which returns “out” and “out” is compared against “data” in BCE function…
I have tried to utilise the BCEwithLogits as well as the above function and this also failed at epoch 38ish…
There is something strange happening in that region but i have looked at all the outputs for epoch 36 onwards and cannot see the problem, i am begining to think that the problem is more fundamental…