allenai / deep_qa

A deep NLP library, based on Keras / tf, focused on question answering (but useful for other NLP too)
Apache License 2.0
404 stars 132 forks source link

Ranking loss #350

Closed matt-gardner closed 7 years ago

matt-gardner commented 7 years ago

This is implementing a couple of simple ranking loss functions, in a way that makes it so we don't have to change our data types at all - you can just replace categorical cross entropy loss with this loss function, and things should just work (though you probably should also modify the last layer of your model to no longer do a softmax, which would make it impossible to get a score of 0 on the hinge loss).

The next PR will actually add some options to a model or two to allow using these loss functions.