meteorshowers / RCF-pytorch

Richer Convolutional Features for Edge Detection model in pytorch CVPR2017
510 stars 145 forks source link

函数cross_entropy_loss_RCF有疑问 #18

Open YFZh opened 5 years ago

YFZh commented 5 years ago

对交叉熵两项加权,你用的是torch.nn.functional..binary_cross_entropy(input, target, weight=None, size_average=None, reduce=None, reduction='mean'),但是其中参数weight是对batch加权的,不是对交叉项加权。不知道我的理解是否正确。 参见pytorch文档 https://pytorch.org/docs/stable/nn.html?highlight=torch%20nn%20functional%20binary#torch.nn.BCELoss

luowy1001 commented 5 years ago

pytorch中 binary_cross_entropy 和 torch.nn.BCELoss 这两者不同

CNHNLP commented 5 years ago

@YFZh 在计算的时候,图片中的每个像素点也可以看作一个batch

YFZh commented 5 years ago

@luowy1001 See BCELoss for details.

YFZh commented 5 years ago

@CNHNLP好像不是这么理解吧