未验证 提交 77a2c457 编写于 作者: B Bin Lu 提交者: GitHub

Update cosmargin.py

上级 6f2959af
......@@ -43,7 +43,7 @@ class CosMargin(paddle.nn.Layer):
cos = paddle.matmul(input, weight)
cos_m = cos - self.margin
one_hot = paddle.nn.functional.one_hot(label, self.out_dim)
one_hot = paddle.nn.functional.one_hot(label, self.class_num)
one_hot = paddle.squeeze(one_hot, axis=[1])
output = paddle.multiply(one_hot, cos_m) + paddle.multiply((1.0 - one_hot), cos)
output = output * self.scale
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册