目录 1 多分类 2 二分类 2.1 torch.nn.BCELoss() 2.2 torch.nn.BCEWithLogitsLoss() 1 多分类 在pytorch中,例如我们最常用的计算一条数据的交叉熵(下面的公式少打了 ∗ 1 N *\frac{1}{N} ∗N