How can I use TensorFlow's sampled softmax loss function in a Keras model?
I'm training a language model in Keras and would like to speed up training by using sampled softmax as the final activation function in my network. From the TF docs, it looks like I need to supply arguments for weights and biases , but I'm unsure of what is expected as input for these. It seems like I could write a custom function in Keras as follows: import keras.backend as K def sampled_softmax(weights, biases, y_true, y_pred, num_sampled, num_classes): return K.sampled_softmax(weights, biases, y_true, y_pred, num_sampled, num_classes) However, I'm unsure of how to "plug this in" to my