Implementation of dice loss - vision - PyTorch Forums
discuss.pytorch.org › t › implementation-of-diceAug 16, 2019 · Hi All, I am trying to implement dice loss for semantic segmentation using FCN_resnet101. For some reason, the dice loss is not changing and the model is not updated. import torch import torchvision import loader from loader import DataLoaderSegmentation import torch.nn as nn import torch.optim as optim import numpy as np from torch.utils.data.sampler import SubsetRandomSampler from torch ...
GitHub - sunshower76/DiceLoss-Pytorch: Implementation ...
github.com › sunshower76 › DiceLoss-PytorchFeb 11, 2020 · from binaryDice_Loss_Score import binaryDiceCoeff # case of 1 mask & ground truth sum_dice = 0 dice_score = binaryDiceCoeff (predicted_mask, ground_truth_mask) sum_dice += dice_score result_dice = sum_dice / total_number_of_images # case of batch of mask & ground truth sum_dice = 0 dice_score = binaryDiceCoeff (predicted_mask_batch, ground_truth_mask_batch) sum_dice += dice_score result_dice ...