未验证 提交 274c216c 编写于 作者: D Double_V 提交者: GitHub

Merge pull request #7537 from LDOUBLEV/26_doc

[bugfix]fix bug about paddle.sum in rec_aster_loss.py
...@@ -27,8 +27,7 @@ class CosineEmbeddingLoss(nn.Layer): ...@@ -27,8 +27,7 @@ class CosineEmbeddingLoss(nn.Layer):
self.epsilon = 1e-12 self.epsilon = 1e-12
def forward(self, x1, x2, target): def forward(self, x1, x2, target):
similarity = paddle.sum( similarity = paddle.sum(x1 * x2, axis=-1) / (paddle.norm(
x1 * x2, dim=-1) / (paddle.norm(
x1, axis=-1) * paddle.norm( x1, axis=-1) * paddle.norm(
x2, axis=-1) + self.epsilon) x2, axis=-1) + self.epsilon)
one_list = paddle.full_like(target, fill_value=1) one_list = paddle.full_like(target, fill_value=1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册