[f77492]: / loss / __pycache__ / dice.cpython-36.pyc

Download this file

8 lines (8 with data), 734 Bytes

3

 \–aSã@sddlZddlTdd„ZdS)éNé)Ú*cCsÆ|dk}|tj|ƒk}t|ƒ}t|ƒ}||}tj|dd}tj|dd}||}tj|dd}tj|dd}||}tj|dd}tj|dd}d|||d}ddtj|ƒ|jdƒ}|S)zw
    2d dice loss
    :param input: predict tensor
    :param target: target tensor
    :return: scalar loss value
    gà?é)Údimgíµ ÷ư>rr)ÚtorchÚmaxZto_float_and_cudaÚsumÚsize)ÚinputÚtargetÚnumZden1Zden2ÚdiceZ
dice_total©rú'/home/ws/yanghan/Newcode/losses/dice.pyÚ	dice_losss r)rÚutilsrrrrrÚ<module>s