class_docstr: ## FFN module with [FTA](index.html) activation
class_docstr_tok: ["#","#","FFN","module","with","[","FTA","]","(","index.html",")","activation"]
docstr: * `d_model` is the number of features in a token embedding
  * `d_ff` is the number of features in the hidden layer of the FFN
  * `activation` is FTA activation module
  * `dropout` is dropout probability for the hidden layer
docstr_tok: ["*","`","d_model","`","is","the","number","of","features","in","a","token","embedding","*","`","d_ff","`","is","the","number","of","features","in","the","hidden","layer","of","the","FFN","*","`","activation","`","is","FTA","activation","module","*","`","dropout","`","is","dropout","probability","for","the","hidden","layer"]
code: def __init__(
      self,
      d_model: int,
      d_ff: int,
      activation: FTA,
      dropout: float = 0.1,
  ):
      """
      * `d_model` is the number of features in a token embedding
      * `d_ff` is the number of features in the hidden layer of the FFN
      * `activation` is FTA activation module
      * `dropout` is dropout probability for the hidden layer
      """
      super().__init__()
      # Layer one parameterized by weight $W_1$ and bias $b_1$
      self.layer1 = nn.Linear(d_model, d_ff)
      # Layer two parameterized by weight $W_1$ and bias $b_1$
      self.layer2 = nn.Linear(
          d_ff * activation.expansion_factor, d_model
      )
      # Hidden layer dropout
      self.dropout = nn.Dropout(dropout)
      # Activation function $f$
      self.activation = activation
  
imports: import copy
  import torch
  import torch.nn
  from labml import experiment
  from labml.configs import option
  from labml_helpers.module import Module
  from labml_nn.activations.fta import FTA
  from labml_nn.experiments.nlp_autoregression import NLPAutoRegressionConfigs
  from labml_nn.transformers import MultiHeadAttention, TransformerLayer
  from labml_nn.transformers.utils import subsequent_mask
label_desc: Use image node_id 1 to create a new FeedForwardFTA object from inherited base classes: nn with example: obj = FeedForwardFTA(d_model, d_ff, activation, dropout)