We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
It seems that the word embedding are kept static during training. How to make the embedding changeable in backpropagation?
The text was updated successfully, but these errors were encountered:
I know that it is a old issue, but just set the requires_grad parameter to True (the default value is True), like this:
## create the embedding layer self.embedding = nn.Embedding(vocab_size, embedding_dim, padding_idx = 0) self.embedding.load_state_dict({'weight': embedding_weights}) self.embedding.weight.requires_grad = True
In this case, I am loading a pretrained embedding weights into a embedding layer and setting it to be trainable during the training process.
Sorry, something went wrong.
No branches or pull requests
It seems that the word embedding are kept static during training.
How to make the embedding changeable in backpropagation?
The text was updated successfully, but these errors were encountered: