class_docstr: Scaled positional encoding module.
  
  See Sec. 3.2  https://arxiv.org/abs/1809.08895
  
  Args:
      d_model (int): Embedding dimension.
      dropout_rate (float): Dropout rate.
      max_len (int): Maximum input length.
class_docstr_tok: ["Scaled","positional","encoding","module",".","See","Sec",".","3.2","https",":","\/\/arxiv.org\/abs\/1809.08895","Args",":","d_model","(","int",")",":","Embedding","dimension",".","dropout_rate","(","float",")",":","Dropout","rate",".","max_len","(","int",")",":","Maximum","input","length","."]
docstr: Initialize class.
docstr_tok: ["Initialize","class","."]
code: def __init__(self, d_model, dropout_rate, max_len=5000):
      """Initialize class."""
      super().__init__(
          d_model=d_model, dropout_rate=dropout_rate, max_len=max_len
      )
      self.alpha = torch.nn.Parameter(torch.tensor(1.0))
  
imports: import math
  import torch
label_desc: Use image node_id 1 to create a new ScaledPositionalEncoding object from inherited base classes: PositionalEncoding with example: obj = ScaledPositionalEncoding(d_model, dropout_rate, max_len)