I'm working with a highly skewed count dataset that's typically fit with a negative binomial. I want to use the negative binomial as a loss functions in Keras or Tensorflow on a feed forward neural network.
To my knowledge, after looking through available loss functions, such a function doesn't exist for keras or tensorflow (although I'm hoping I'm wrong and I just missed something).
I've looked around and I've seen posts suggest just swapping out the loss to include the negative binomial, but it appears there's more to creating a custom loss in tensorflow than just swapping it out with tf.contrib.distributions.NegativeBinomial
I'm wondering if 1) anyone has already created a loss function using negative binomial and is willing to share how it was coded or 2) tips on how to make this work.
I'm working exclusively in python on this project.
Appreciate all the help in advance.