ncalab.models.applications.segmentation ======================================= .. py:module:: ncalab.models.applications.segmentation Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/ncalab/models/applications/segmentation/segmentationNCA/index Classes ------- .. autoapisummary:: ncalab.models.applications.segmentation.SegmentationNCAModel Package Contents ---------------- .. py:class:: SegmentationNCAModel(device: torch.device, num_image_channels: int = 3, num_hidden_channels: int = 16, num_classes: int = 1, fire_rate: float = 0.8, hidden_size: int = 128, num_learned_filters: int = 2, pad_noise: bool = True, filter_padding: str = 'reflect', **kwargs) Bases: :py:obj:`ncalab.models.basicNCA.BasicNCAModel` Model used for image segmentation. Uses Dice score as the default validation metric. Currently, only binary segmentation masks are supported. :param device [torch.device]: Compute device. :param num_image_channels [int]: Number of image channels. Defaults to 3. :param num_hidden_channels [int]: Number of hidden channels. Defaults to 16. :param num_classes [int]: Number of classes. Defaults to 1. :param fire_rate [float]: NCA fire rate. Defaults to 0.8. :param hidden_size [int]: Number of neurons in hidden layer. Defaults to 128. :param learned_filters [int]: Number of learned filters. If 0, use sobel. Defaults to 2. :param pad_noise [bool]: Whether to pad input images with noise. Defaults to True. :param filter_padding [str]: Padding type to use. Might affect reliance on spatial cues. Defaults to "circular". .. py:attribute:: num_classes :value: 1 .. py:method:: loss(pred: ncalab.prediction.Prediction, label: torch.Tensor) -> Dict[str, torch.Tensor] Compute Dice + BCE loss. :param pred: Prediction. :param label: Ground truth. :returns: Dictionary of identifiers mapped to computed losses. .. py:method:: metrics(pred: ncalab.prediction.Prediction, label: torch.Tensor) -> Dict[str, float] Return dict of standard evaluation metrics. :param pred [torch.Tensor]: Predicted image. :param label [torch.Tensor]: Ground truth label.