torch.nn.EmbeddingOptions
export interface EmbeddingOptions {
/** If specified, embedding at this index is fixed to zero (for padding tokens) */
padding_idx?: number;
/** If specified, embeddings are renormalized to max norm during forward pass */
max_norm?: number;
/** Type of norm for max_norm constraint (default: L2 norm = 2.0) */
norm_type?: number;
/** If true, gradients scaled by frequency of token in mini-batch */
scale_grad_by_freq?: boolean;
/** Reserved for sparse gradient support (not yet implemented) */
sparse?: boolean;
}padding_idx(number)optional- – If specified, embedding at this index is fixed to zero (for padding tokens)
max_norm(number)optional- – If specified, embeddings are renormalized to max norm during forward pass
norm_type(number)optional- – Type of norm for max_norm constraint (default: L2 norm = 2.0)
scale_grad_by_freq(boolean)optional- – If true, gradients scaled by frequency of token in mini-batch
sparse(boolean)optional- – Reserved for sparse gradient support (not yet implemented)
Options for Embedding layer