Skip to content
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

网络结构中Model加载预训练词向量的疑问 #117

Open
hgsw opened this issue Mar 11, 2024 · 1 comment
Open

网络结构中Model加载预训练词向量的疑问 #117

hgsw opened this issue Mar 11, 2024 · 1 comment

Comments

@hgsw
Copy link

hgsw commented Mar 11, 2024

if config.embedding_pretrained is not None:
self.embedding = nn.Embedding.from_pretrained(config.embedding_pretrained, freeze=False)

这里的freeze=Fasle 不是很理解,难道说词向量需要随着训练过程进行参数更新?
torch 2.0.1 版本是True 描述为不参数网络参数更新?
Args:
embeddings (Tensor): FloatTensor containing weights for the Embedding.
First dimension is being passed to Embedding as num_embeddings, second as embedding_dim.
freeze (bool, optional): If True, the tensor does not get updated in the learning process.
Equivalent to embedding.weight.requires_grad = False. Default: True

@NeiMengNumberOne
Copy link

同问,解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants