Skip to content

Commit

Permalink
Fix complex loss name (qubvel#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
qubvel authored Oct 4, 2019
1 parent 886a545 commit c0524e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions segmentation_models/base/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def __init__(self, loss, multiplier):

# resolve name
if len(loss.__name__.split('+')) > 1:
name = '{} * ({})'.format(multiplier, loss.__name__)
name = '{}({})'.format(multiplier, loss.__name__)
else:
name = '{} * {}'.format(multiplier, loss.__name__)
name = '{}{}'.format(multiplier, loss.__name__)
super().__init__(name=name)
self.loss = loss
self.multiplier = multiplier
Expand All @@ -105,7 +105,7 @@ def __call__(self, gt, pr):
class SumOfLosses(Loss):

def __init__(self, l1, l2):
name = '{} + {}'.format(l1.__name__, l2.__name__)
name = '{}_plus_{}'.format(l1.__name__, l2.__name__)
super().__init__(name=name)
self.l1 = l1
self.l2 = l2
Expand Down

0 comments on commit c0524e3

Please sign in to comment.