class_docstr: Overwrites the PyTorch TransformerEncoderLayer to use Darts' Position-wise Feed-Forward variants.
class_docstr_tok: ["Overwrites","the","PyTorch","TransformerEncoderLayer","to","use","Darts","'","Position-wise","Feed-Forward","variants","."]
docstr: Parameters
  ----------
  ffn
      One of Darts' Position-wise Feed-Forward Network variants from darts.models.components.glu_variants
  dropout
      Fraction of neurons affected by Dropout (default=0.1).
  args
      positional arguments from torch.nn.TransformerEncoderLayer.
  kwargs
      keyword arguments from torch.nn.TransformerEncoderLayer. `activation` will have no effect.
docstr_tok: ["Parameters","--","--","--","--","--","ffn","One","of","Darts","'","Position-wise","Feed-Forward","Network","variants","from","darts.models.components.glu_variants","dropout","Fraction","of","neurons","affected","by","Dropout","(","default=0.1",")",".","args","positional","arguments","from","torch.nn.TransformerEncoderLayer",".","kwargs","keyword","arguments","from","torch.nn.TransformerEncoderLayer",".","`","activation","`","will","have","no","effect","."]
code: def __init__(self, ffn: nn.Module, dropout: float, *args, **kwargs):
      """
      Parameters
      ----------
      ffn
          One of Darts' Position-wise Feed-Forward Network variants from darts.models.components.glu_variants
      dropout
          Fraction of neurons affected by Dropout (default=0.1).
      args
          positional arguments from torch.nn.TransformerEncoderLayer.
      kwargs
          keyword arguments from torch.nn.TransformerEncoderLayer. `activation` will have no effect.
      """
      super().__init__(*args, **kwargs)
      self.ffn = ffn
      self.dropout = MonteCarloDropout(dropout)
  
file_path: darts/darts/models/components/transformer.py
imports: import torch
  import torch.nn
  from darts.utils.torch import MonteCarloDropout
label_desc: Use image node_id 1 to create a new CustomFeedForwardEncoderLayer object from inherited base classes: nn with example: obj = CustomFeedForwardEncoderLayer(ffn, dropout)