Binary_crossentropy producing negative loss values #13926
Labels
stat:awaiting response from contributor
type:support
User is asking for help / asking an implementation question. Stackoverflow would be better suited.
Hi all,
I have a built a classifier to learn various features of data. I am now using the functional API as i would also like to create a predictor of a class in my data at the same time. so as oppose to having 30 classes to classify (as in the normal sequential model) i would also like to use the same input to see if it can predict one class in the data. The code is as follows:
Then build and compile model. one input with two outputs:: one for the classification, and one to predict based on the data if it can learn which class it belongs based on all the data (output for this is 1)
i achieve good accuracy for both outputs, however, i am reaching negative loss values for the outputsingle class.. an example of the last line of epoch 20 shows:
outputClass_loss: 0.2093 - outputRegress_loss: -9.1634 - outputClass_accuracy: 0.9094 - outputRegress_accuracy: 0.659318/318 [==============================] - 1s 2ms/sample - loss: -9.2815 - outputClass_loss: 0.2075 - outputRegress_loss: -9.5086 - outputClass_accuracy: 0.9102 - outputRegress_accuracy: 0.6667 - val_loss: 9.5608 - val_outputClass_loss: 0.3463 - val_outputRegress_loss: 10.6915 - val_outputClass_accuracy: 0.8740 - val_outputRegress_accuracy: 0.6125
the loss values are all very odd. any help here would be appreciated! thanks!
The text was updated successfully, but these errors were encountered: