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

Method __init__

loss/utils.py:126–131  ·  view source on GitHub ↗
(self, weight=None, ignore_index=cfg.DATASET.IGNORE_LABEL,
                 reduction='mean')

Source from the content-addressed store, hash-verified

124 """
125
126 def __init__(self, weight=None, ignore_index=cfg.DATASET.IGNORE_LABEL,
127 reduction='mean'):
128 super(CrossEntropyLoss2d, self).__init__()
129 logx.msg("Using Cross Entropy Loss")
130 self.nll_loss = nn.NLLLoss(weight, reduction=reduction,
131 ignore_index=ignore_index)
132
133 def forward(self, inputs, targets, do_rmi=None):
134 return self.nll_loss(F.log_softmax(inputs, dim=1), targets)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected