This loss combines a Sigmoid layer and the BCELoss in one single class. This version is more numerically stable than using a plain Sigmoid followed by a BCELoss as, by combining the operations into one layer, we take advantage of the log-sum-exp trick for numerical stability.
在我看来,你的乙状结肠已经饱和了。图像未正确标准化或缺少一些批次的归一化层。如果您有一个正在处理其他图像的实现,请检查图像加载器并确保它不会使像素值饱和。这通常发生在16位信道上。你能分享一些输入图像吗?在
很抱歉在回答中发表评论。这是一个新帐户,我还不能评论。在
您可能需要使用
torch.nn.BCEWithLogitsLoss()
,替换Sigmoid和BCELoss函数。在从docs中摘录的内容告诉您为什么使用这种丢失函数实现总是更好。在
相关问题 更多 >
编程相关推荐