MCPcopy Create free account
hub / github.com/NVIDIA/semantic-segmentation / __init__

Method __init__

loss/utils.py:75–85  ·  view source on GitHub ↗
(self, classes, weight=None, ignore_index=cfg.DATASET.IGNORE_LABEL,
                 norm=False, upper_bound=1.0, fp16=False)

Source from the content-addressed store, hash-verified

73 """
74
75 def __init__(self, classes, weight=None, ignore_index=cfg.DATASET.IGNORE_LABEL,
76 norm=False, upper_bound=1.0, fp16=False):
77 super(ImageBasedCrossEntropyLoss2d, self).__init__()
78 logx.msg("Using Per Image based weighted loss")
79 self.num_classes = classes
80 self.nll_loss = nn.NLLLoss(weight, reduction='mean',
81 ignore_index=ignore_index)
82 self.norm = norm
83 self.upper_bound = upper_bound
84 self.batch_weights = cfg.BATCH_WEIGHTING
85 self.fp16 = fp16
86
87 def calculate_weights(self, target):
88 """

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected