ncalab.losses ============= .. py:module:: ncalab.losses Classes ------- .. autoapisummary:: ncalab.losses.DiceScore ncalab.losses.DiceBCELoss Module Contents --------------- .. py:class:: DiceScore Bases: :py:obj:`torch.nn.Module` Pytorch Module that computes the Dice overlap score between two images. Initialize internal Module state, shared by both nn.Module and ScriptModule. .. py:method:: forward(x: torch.Tensor, y: torch.Tensor, smooth: float = 1.0) -> torch.Tensor :param x: Reference Input :type x: torch.Tensor :param y: Other Input :type y: torch.Tensor :param smooth: Smooting factor, defaults to 1.0 :type smooth: float :returns: Dice score :rtype: torch.Tensor .. py:class:: DiceBCELoss Bases: :py:obj:`torch.nn.Module` Combination of Dice and BCE Loss between two images. Initialize internal Module state, shared by both nn.Module and ScriptModule. .. py:attribute:: dicescore .. py:method:: forward(x: torch.Tensor, y: torch.Tensor, smooth: float = 1.0) -> torch.Tensor :param x: Reference Input :type x: torch.Tensor :param y: Other Input :type y: torch.Tensor :param smooth: Smooting factor, defaults to 1.0 :type smooth: float :returns: Dice score :rtype: torch.Tensor