评价此页

torch.nn.functional.multilabel_soft_margin_loss#

torch.nn.functional.multilabel_soft_margin_loss(input, target, weight=None, size_average=None, reduce=None, reduction='mean')[source]#

计算多标签软边距损失。

有关详细信息,请参阅 MultiLabelSoftMarginLoss

参数
  • input (Tensor) – 预测值。

  • target (Tensor) – 真值。

  • size_average (bool, optional) – 已弃用(请参阅 reduction)。

  • reduce (bool, optional) – 已弃用(请参阅 reduction)。

  • reduction (str, optional) – 指定应用于输出的约简:‘none’ | ‘mean’ | ‘sum’。‘mean’:取输出的平均值。‘sum’:将对输出进行求和。‘none’:不应用任何约简。默认值:“mean”。

返回

多标签软边距损失。

返回类型

张量