https://github.com/cyberzhg/keras-losses
Some loss functions in Keras
https://github.com/cyberzhg/keras-losses
coral-loss keras loss-functions ranking-loss
Last synced: 4 months ago
JSON representation
Some loss functions in Keras
- Host: GitHub
- URL: https://github.com/cyberzhg/keras-losses
- Owner: CyberZHG
- License: mit
- Archived: true
- Created: 2018-10-10T07:10:45.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T12:02:05.000Z (over 3 years ago)
- Last Synced: 2025-02-13T08:54:24.084Z (5 months ago)
- Topics: coral-loss, keras, loss-functions, ranking-loss
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 10
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Keras Losses
Some loss functions in Keras.
## Install
```bash
python setup.py install
```## Usage
### Ranking Loss

```python
from keras_losses import get_ranking_lossranking_loss = get_ranking_loss(gamma=2.0, mp=2.5, mn=0.5)
```### Weighted Categorical Cross-Entropy Loss

```python
from keras_losses import get_weighted_categorical_crossentropy, get_weighted_sparse_categorical_crossentropyweighted_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



```python
from keras_losses import coral_loss
```