摘要: import torch.nn as nn x = F.log_softmax(x) y = F.softmax(y, dim=1) criterion = nn.KLDivLoss() klloss = criterion(x, y) 输入x :(自己生成的标签)需要经过log_softmax层, 阅读全文
posted @ 2022-03-23 12:39 zxcayumi 阅读(616) 评论(0) 推荐(0)