-
Notifications
You must be signed in to change notification settings - Fork 5.8k
nn.Embedding/F.embedding
support scale_grad_by_freq
易用性提升
#70090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -1714,6 +1714,8 @@ class Embedding(Layer): | |||
The local word vector needs to be transformed into numpy format, and the shape of local word | |||
vector should be consistent with :attr:`num_embeddings` . Then :ref:`api_paddle_nn_initializer_Assign` | |||
is used to load custom or pre-trained word vectors. See code example for details. | |||
scale_grad_by_freq(bool, optional): Indicating whether to scale the gradients by the inverse frequency of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是新增参数,且是最后面的的,按道理直接修改原kernel不会不兼容吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/PaddlePaddle/Paddle/pull/70124/files
我不知道是不是哪里配置的不对
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/PaddlePaddle/Paddle/pull/70124/files 我不知道是不是哪里配置的不对
这个kernel的命名优化一下吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Category
User Experience
PR Types
Improvements
Description
为避免不兼容修改,新增 embedding_with_scaled_gradient op,前向复用 embedding_kernel,反向新增 embedding_with_scaled_gradient_grad_kernel。