Skip to content

Commit e13aa94

Browse files
authored
Merge pull request #198 from kozistr/feature/loss-functions
[Feature] Implement loss functions
2 parents 19b8519 + 6642951 commit e13aa94

File tree

13 files changed

+373
-104
lines changed

13 files changed

+373
-104
lines changed

README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pytorch-optimizer
1616

1717
| **pytorch-optimizer** is optimizer & lr scheduler collections in PyTorch.
1818
| I just re-implemented (speed & memory tweaks, plug-ins) the algorithm while based on the original paper. Also, It includes useful and practical optimization ideas.
19-
| Currently, 59 optimizers, 10 lr schedulers, and 10 loss functions are supported!
19+
| Currently, 59 optimizers, 10 lr schedulers, and 13 loss functions are supported!
2020
|
2121
| Highly inspired by `pytorch-optimizer <https://github.com/jettify/pytorch-optimizer>`__.
2222
@@ -270,6 +270,10 @@ You can check the supported loss functions with below code.
270270
+---------------------+-------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
271271
| Bi-Tempered | *The Principle of Unchanged Optimality in Reinforcement Learning Generalization* | | `https://arxiv.org/abs/1906.03361 <https://arxiv.org/abs/1906.03361>`__ | `cite <https://ui.adsabs.harvard.edu/abs/2019arXiv190600336I/exportcitation>`__ |
272272
+---------------------+-------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
273+
| Tversky | *Tversky loss function for image segmentation using 3D fully convolutional deep networks* | | `https://arxiv.org/abs/1706.05721 <https://arxiv.org/abs/1706.05721>`__ | `cite <https://ui.adsabs.harvard.edu/abs/2017arXiv170605721S/exportcitation>`__ |
274+
+---------------------+-------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
275+
| Lovasz Hinge | *A tractable surrogate for the optimization of the intersection-over-union measure in neural networks* | `github <https://github.com/bermanmaxim/LovaszSoftmax>`__ | `https://arxiv.org/abs/1705.08790 <https://arxiv.org/abs/1705.08790>`__ | `cite <https://github.com/bermanmaxim/LovaszSoftmax#citation>`__ |
276+
+---------------------+-------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
273277

274278
Useful Resources
275279
----------------

docs/changelogs/v2.11.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
### Feature
44

5+
* Implement Tiger optimizer (#192)
6+
* [A Tight-fisted Optimizer](https://github.com/bojone/tiger/blob/main/README_en.md)
57
* Implement CAME optimizer (#196)
68
* [Confidence-guided Adaptive Memory Efficient Optimization](https://aclanthology.org/2023.acl-long.243/)
9+
* Implement loss functions (#198)
10+
* Tversky Loss : [Tversky loss function for image segmentation using 3D fully convolutional deep networks](https://arxiv.org/abs/1706.05721)
11+
* Focal Tversky Loss
12+
* Lovasz Hinge Loss : [The Lovász-Softmax loss: A tractable surrogate for the optimization of the intersection-over-union measure in neural networks](https://arxiv.org/abs/1705.08790)
713

814
### Diff
915

docs/loss_api.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,27 @@ BinaryBiTemperedLogisticLoss
8080

8181
.. autoclass:: pytorch_optimizer.BinaryBiTemperedLogisticLoss
8282
:members:
83+
84+
.. _TverskyLoss:
85+
86+
TverskyLoss
87+
-----------
88+
89+
.. autoclass:: pytorch_optimizer.TverskyLoss
90+
:members:
91+
92+
.. _FocalTverskyLoss:
93+
94+
FocalTverskyLoss
95+
----------------
96+
97+
.. autoclass:: pytorch_optimizer.FocalTverskyLoss
98+
:members:
99+
100+
.. _LovaszHingeLoss:
101+
102+
LovaszHingeLoss
103+
---------------
104+
105+
.. autoclass:: pytorch_optimizer.LovaszHingeLoss
106+
:members:

0 commit comments

Comments
 (0)