Add missing docstring for Embedding.pretrained_file
@@ -44,7 +44,7 @@ class Embedding(TokenEmbedder):
Parameters
----------
- num_embeddings : int:
+ num_embeddings : int
Size of the dictionary of embeddings (vocabulary size).
embedding_dim : int
The size of each embedding vector.
@@ -60,18 +60,22 @@ class Embedding(TokenEmbedder):
Whether or not to optimize the embedding parameters.
max_norm : float, (optional, default=None)
If given, will renormalize the embeddings to always have a norm lesser than this
- norm_type : float, (optional, default=2):
+ norm_type : float, (optional, default=2)
The p of the p-norm to compute for the max_norm option
- scale_grad_by_freq : boolean, (optional, default=False):
+ scale_grad_by_freq : boolean, (optional, default=False)
If given, this will scale gradients by the frequency of the words in the mini-batch.
- sparse : bool, (optional, default=False):
+ sparse : bool, (optional, default=False)
Whether or not the Pytorch backend should use a sparse representation of the embedding weight.
- vocab_namespace : str, (optional, default=None):
+ vocab_namespace : str, (optional, default=None)
In case of fine-tuning/transfer learning, the model's embedding matrix needs to be
extended according to the size of extended-vocabulary. To be able to know how much to
extend the embedding-matrix, it's necessary to know which vocab_namspace was used to
construct it in the original training. We store vocab_namespace used during the original
training as an attribute, so that it can be retrieved during fine-tuning.
+ pretrained_file : str, (optional, default=None)
+ Used to keep track of what is the source of the weights and loading more embeddings at test time.
+ **It does not load the weights from this pretrained_file.** For that purpose, use
+ ``Embedding.from_params``.
Returns
-------
