Created
October 17, 2020 07:43
-
-
Save satishgunjal/de66a43915327cfc4bb300a78f66f9ff to your computer and use it in GitHub Desktop.
model compile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The from_logits=True attribute inform the loss function that the output values generated by the model are not normalized, a.k.a. logits. | |
# Since softmax layer is not being added at the last layer, hence we need to have the from_logits=True to indicate the probabilities are not normalized. | |
model.compile(optimizer= 'adam', | |
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), | |
metrics = ['accuracy']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment