In the documentation it has been mentioned that y_pred
needs to be in the range of [-inf to inf] when from_logits=True
. I truly didn't understand what this means, since the probabilities need to be in the range of 0 to 1! Can someone please explain in simple words the effect of using from_logits=True
?
model.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
from_normalized
orinput_is_normalized
rather than the rather odd, confusing, off-point and far-from-universal sub-casefrom_logits
. – Peter Leopold May 10 '23 at 14:45