This is what tensorflow has to say about the logits and labels arguments in tf.nn.sparse_softmax_cross_entropy_with_logits
Args: _sentinel: Used to prevent positional parameters. Internal, do not use.
labels:
Tensor
of shape[d_0, d_1, ..., d_{r-1}]
(wherer
is rank oflabels
and result) and dtypeint32
orint64
. Each entry inlabels
must be an index in[0, num_classes)
. Other values will raise an exception when this op is run on CPU, and returnNaN
for corresponding loss and gradient rows on GPU.logits: Unscaled log probabilities of shape
[d_0, d_1, ..., d_{r-1}, num_classes]
and dtypefloat32
orfloat64
. name: A name for the operation (optional).
I have worked on my fair share of machine learning and deep learning classification problems and the only output shape that i have come across or even think of is [None, 1] or [None, number of classes](if the sparse implementation is not implemented.)
Please shed some light on where do: Tensor
(labels) of shape [d_0, d_1, ..., d_{r-1}]
and 'Tensor' (logits) Unscaled log probabilities of shape
[d_0, d_1, ..., d_{r-1}, num_classes]
come from. Maybe just an example would suffice