From a2503a41a5a3fd42a31d2345ae4115f13aaaf256 Mon Sep 17 00:00:00 2001 From: fcakyon Date: Mon, 16 Dec 2024 21:24:59 +0300 Subject: [PATCH] Update author information in setup.py and enhance forward method signature in Loss class for improved readability --- balanced_loss/losses.py | 8 ++------ setup.py | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/balanced_loss/losses.py b/balanced_loss/losses.py index 5d7bc83..eceab97 100644 --- a/balanced_loss/losses.py +++ b/balanced_loss/losses.py @@ -44,7 +44,7 @@ def __init__( fl_gamma=2, samples_per_class=None, class_balanced=False, - safe: bool = False + safe: bool = False, ): """ Compute the Class Balanced Loss between `logits` and the ground truth `labels`. @@ -77,11 +77,7 @@ def __init__( self.class_balanced = class_balanced self.safe = safe - def forward( - self, - logits: torch.tensor, - labels: torch.tensor - ): + def forward(self, logits: torch.tensor, labels: torch.tensor): """ Compute the Class Balanced Loss between `logits` and the ground truth `labels`. Class Balanced Loss: ((1-beta)/(1-beta^n))*Loss(labels, logits) diff --git a/setup.py b/setup.py index ff789ae..b22d7dc 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ def get_version(): setuptools.setup( name="balanced-loss", version=get_version(), - author="", + author="fcakyon", license="MIT", description="Easy to use class-balanced cross-entropy and focal loss implementation for Pytorch.", long_description=get_long_description(), @@ -54,9 +54,9 @@ def get_version(): "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Education",