代码拉取完成,页面将自动刷新
.. py:class:: mindsponge.metrics.MultiClassFocal(num_class, beta=0.99, gamma=2., e=0.1, neighbors=2, not_focal=False, reducer_flag=False) 计算多分类中预测值和真实值之间的焦点损失,详细实现过程参考: `Lin, Tsung-Yi, et al. 'Focal loss for dense object detection' <https://arxiv.org/abs/1708.02002>`_ 。 参数: - **num_class** (int) - 分类类别数。 - **beta** (float) - 滑动平均的系数。默认值: ``0.99``。 - **gamma** (float) - 超参数。默认值: ``2.0``。 - **e** (float) - 比例系数,focal误差占比。默认值: ``0.1``。 - **neighbors** (int) - 标签中需要mask的邻居数。默认值: ``2``。 - **not_focal** (bool) - 是否使用focal误差。默认值: ``False``。 - **reducer_flag** (bool) - 是否对多卡的标签值做聚合。默认值: ``False``。 输入: - **prediction** (Tensor) - 模型预测值,shape为 :math:`(batch\_size, ndim)` 。 - **target** (Tensor) - 标签值,shape为 :math:`(batch\_size, ndim)` 。 输出: Tensor。shape为 :math:`(batch\_size, )` 。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。