INNER CODE UNIT · Python

__init__

nv-tlabs/GSCNN · loss.py:154

    def __init__(self, weight=None, size_average=True, ignore_index=255):
        super(CrossEntropyLoss2d, self).__init__()
        logging.info("Using Cross Entropy Loss")
        self.nll_loss = nn.NLLLoss2d(weight, size_average, ignore_index)

    def forward(self, inputs, targets):
        return self.nll_loss(F.log_softmax(inputs), targets)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…