Classification problems, such as logistic regression or multinomial
logistic regression, optimize a **cross-entropy** loss.
Normally, the cross-entropy layer follows the **softmax** layer,
which produces probability distribution.

In tensorflow, there are at least a **dozen of different cross-entropy loss functions**:

* `tf.losses.softmax_cross_entropy`
* `tf.losses.sparse_softmax_cross_entropy`
* `tf.losses.sigmoid_cross_entropy`
* `tf.contrib.losses.softmax_cross_entropy`
* `tf.contrib.losses.sigmoid_cross_entropy`
* `tf.nn.softmax_cross_entropy_with_logits`
* `tf.nn.sigmoid_cross_entropy_with_logits`
* ...

Which one works only for binary classification and which are suitable for multi-class problems? When should you use `sigmoid` instead of `softmax`? How are `sparse` functions different from others and why is it only `softmax`?

Related (more math-oriented) discussion: [What are the differences between all these cross-entropy losses in Keras and TensorFlow?](https://stackoverflow.com/q/44674847/712995).