Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

CyberZHG/keras-losses

Repository files navigation

Keras Losses

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])

CORAL Loss

from keras_losses import coral_loss

Releases

No releases published

Packages

No packages published