Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: torch
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- pytorch
|
| 6 |
+
- loss-functions
|
| 7 |
+
- deep-learning
|
| 8 |
+
- machine-learning
|
| 9 |
+
- library
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# torchlosses
|
| 13 |
+
|
| 14 |
+
A lightweight library of advanced **PyTorch loss functions** β ready to plug into your training loop.
|
| 15 |
+
Designed for deep learning practitioners who want more than just MSE and CrossEntropy.
|
| 16 |
+
|
| 17 |
+
Available on **PyPI**: [torchlosses](https://pypi.org/project/torchlosses/)
|
| 18 |
+
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
## Features
|
| 22 |
+
- **Focal Loss** β handle class imbalance in classification.
|
| 23 |
+
- **Dice Loss** β segmentation-friendly overlap metric.
|
| 24 |
+
- **Contrastive Loss** β learn pairwise similarity (Siamese nets).
|
| 25 |
+
- **Triplet Loss** β enforce anchor-positive vs negative separation.
|
| 26 |
+
- **Cosine Embedding Loss** β similarity learning with cosine distance.
|
| 27 |
+
- **Huber Loss** β robust regression, less sensitive to outliers.
|
| 28 |
+
- **KL Divergence Loss** β probability distribution alignment.
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## Created By
|
| 33 |
+
|
| 34 |
+
Naga Adithya Kaushik (GenAIDevTOProd)
|
| 35 |
+
|
| 36 |
+
## π¦ Installation
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
pip install torchlosses
|