4063565295aae8f739b006ac5ab814c12bd8a81e,myloss.py,,dice_coeff,#,30

Before Change


        return grad_input, grad_target

def dice_coeff(input, target):
    return DiceCoeff().forward(input, target)

class DiceLoss(_Loss):
    def forward(self, input, target):
        return 1 - dice_coeff(F.sigmoid(input), target)

After Change


    else:
        s = Variable(torch.FloatTensor(1).zero_())

    for i, c in enumerate(zip(input, target)):
        s = s + DiceCoeff().forward(c[0], c[1])

    return s / (i+1)


class DiceLoss(_Loss):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: milesial/Pytorch-UNet
Commit Name: 4063565295aae8f739b006ac5ab814c12bd8a81e
Time: 2017-08-17
Author: milesial@users.noreply.github.com
File Name: myloss.py
Class Name:
Method Name: dice_coeff


Project Name: tiberiu44/TTS-Cube
Commit Name: 89615a9293d03af8105554419dafdcbcc6c570f6
Time: 2018-09-12
Author: boros@adobe.com
File Name: cube/models/g2p.py
Class Name: G2P
Method Name: learn


Project Name: ina-foss/inaSpeechSegmenter
Commit Name: 688e56c09d028c0a956d1434ee16c60aea820de1
Time: 2018-04-19
Author: eliottlechapt@yahoo.fr
File Name: inaSpeechSegmenter/segmenter.py
Class Name: Segmenter
Method Name: __call__


Project Name: scikit-learn-contrib/sklearn-pandas
Commit Name: 62bf316e1b3809f2db86dfeda10abca809c8b983
Time: 2018-05-05
Author: tsweetser@gmail.com
File Name: sklearn_pandas/dataframe_mapper.py
Class Name: DataFrameMapper
Method Name: transform