STDC-Seg
STDC-Seg copied to clipboard
请问训练时,传入损失函数的ground truth的格式是单通道的么?
请问训练时,传入损失函数的ground truth的格式是单通道的,如 0, 1 ,2, 3, 4, 5, ....这样的格式么? 而不是one hot的 多通道的,如 0, 0, 1, 0, 0, .......这样的格式吧
detail_loss.py文件中的class DetailAggregateLoss的方法 def forward(self, boundary_logits, gtmasks) 这里的gtmasks也就是单通道的格式吧? 在此基础上进行laplacian_kernel 卷积计算?
同时loss.py文件的class OhemCELoss(nn.Module)的方法 def forward(self, logits, labels): 这里的labels也同样是单通道吧?
还请教一个问题:
损失函数boundary_loss_func = DetailAggregateLoss()
调用boundary_loss_func(detail8, lb),其中作为ground truth的lb是包括,ignore_idx=255的,也就是包含了ignore_idx=255的轮廓信息;
而另一个损失函数criteria_p = OhemCELoss(thresh=score_thres, n_min=n_min, ignore_lb=ignore_idx),计算交叉熵的时候,忽略计算类别为ignore_lb=ignore_idx的损失, 请教在模型预测的时候,类别为ignore_idx(=255)的像素块,模型会预测成什么类别呢?
还请教一个问题,损失函数OhemCELoss,如果在单个gpu上训练,n_min应该设置为多少呢? 谢谢