tf.keras.backend.sparse_categorical_crossentropy
Stay organized with collections
Save and categorize content based on your preferences.
Categorical crossentropy with integer targets.
tf.keras.backend.sparse_categorical_crossentropy(
target, output, from_logits=False, axis=-1
)
Arguments |
target
|
An integer tensor.
|
output
|
A tensor resulting from a softmax
(unless from_logits is True, in which
case output is expected to be the logits).
|
from_logits
|
Boolean, whether output is the
result of a softmax, or is a tensor of logits.
|
axis
|
Int specifying the channels axis. axis=-1 corresponds to data
format channels_last', and axis=1corresponds to data format channels_first`.
|
Raises |
ValueError
|
if axis is neither -1 nor one of the axes of output .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[]]