1

I was translating the mnist example in https://www.tensorflow.org/tutorials/ to tflearn from keras. However, in tflearn, there was no sparse_categorical_crossentropy, only categorical_crossentropy. Thus I had to convert all the y vectors (which were just an integer 1...10 specifying which class that image in the data set belonged to) to a 1x10 vector of the form [0...1...0].

In Keras, I can just change between sparse_categorical_crossentropy and categorical_crossentropy depending on if the target is an integer for an index, or a vector of the form [0 0 ... 1 ... 0].

Is there a similar loss function in tflearn or is categorical_crossentropy the only option?

Jonathan Lindgren
  • 1,192
  • 3
  • 14
  • 31

0 Answers0