I have a Keras model that I'm using for a multi-class classification problem. I'm doing this:
model.compile(
loss='categorical_crossentropy',
optimizer='adam',
metrics=['accuracy'],
)
I currently have ~100 features and there are ~2000 possible classes. One-hot encoding the class is leading to memory issues.
Is it possible to use categorical_crossentropy with this Keras model while not one-hot encoding the class labels. E.g. instead of having a target look like:
[0, 0, 0, 1, 0, 0, ...]
It would just be:
3
I looked at the source for categorical_crossentropy in Keras and it assumes two tensors of the same shape. Is there a way to get around this and use the approach I described?
Thanks!
