View source: R/nnf-embedding.R
nnf_embedding_bag | R Documentation |
Computes sums, means or maxes of bags
of embeddings, without instantiating the
intermediate embeddings.
nnf_embedding_bag(
input,
weight,
offsets = NULL,
max_norm = NULL,
norm_type = 2,
scale_grad_by_freq = FALSE,
mode = "mean",
sparse = FALSE,
per_sample_weights = NULL,
include_last_offset = FALSE,
padding_idx = NULL
)
input |
(LongTensor) Tensor containing bags of indices into the embedding matrix |
weight |
(Tensor) The embedding matrix with number of rows equal to the maximum possible index + 1, and number of columns equal to the embedding size |
offsets |
(LongTensor, optional) Only used when |
max_norm |
(float, optional) If given, each embedding vector with norm
larger than |
norm_type |
(float, optional) The |
scale_grad_by_freq |
(boolean, optional) if given, this will scale gradients
by the inverse of frequency of the words in the mini-batch. Default |
mode |
(string, optional) |
sparse |
(bool, optional) if |
per_sample_weights |
(Tensor, optional) a tensor of float / double weights,
or NULL to indicate all weights should be taken to be 1. If specified,
|
include_last_offset |
(bool, optional) if |
padding_idx |
(int, optional) If given, pads the output with the embedding
vector at |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.