cyrilou242 / keras-losses

Some loss functions in Keras

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keras Losses

Travis Coverage

Some loss functions in Keras.

Install

python setup.py install

Usage

Ranking Loss

from keras_losses import get_ranking_loss

ranking_loss = get_ranking_loss(gamma=2.0, mp=2.5, mn=0.5)

Weighted Categorical Cross-Entropy Loss

from keras_losses import get_weighted_categorical_crossentropy, get_weighted_sparse_categorical_crossentropy

weighted_loss = get_weighted_categorical_crossentropy(weights=[0.8, 0.1, 0.2, 0.3, 0.4])
weighted_loss = get_weighted_sparse_categorical_crossentropy(weights=[0.8, 0.1, 0.2, 0.3, 0.4])

About

Some loss functions in Keras

License:MIT License


Languages

Language:Python 96.3%Language:Shell 3.7%