2

I am trying to understand the Tensorflow documentation better for tf.nn.softmax_cross_entropy_with_logits_v2().

In the documentation, it states: While the classes are mutually exclusive, their probabilities need not be. All that is required is that each row of labels is a valid probability distribution. If they are not, the computation of the gradient will be incorrect.

Does this mean that, for my labels, I shouldn't be simply using one-hot encoding, but should also account for the number of instances of each label? For example, if I have 2 classes, and there are 90 examples for class "A" and only 10 examples for class "B", should my label for a class A be [0.9, 0.1], instead of just [1, 0]?

I hope this makes sense. Thanks!

Jmeeks29ig
  • 219
  • 1
  • 7

0 Answers0