class_docstr: This `Module` is a feed-forward neural network, just a sequence of `Linear` layers with
  activation functions in between.
  
  # Parameters
  
  input_dim : `int`, required
      The dimensionality of the input.  We assume the input has shape `(batch_size, input_dim)`.
  num_layers : `int`, required
      The number of `Linear` layers to apply to the input.
  hidden_dims : `Union[int, List[int]]`, required
      The output dimension of each of the `Linear` layers.  If this is a single `int`, we use
      it for all `Linear` layers.  If it is a `List[int]`, `len(hidden_dims)` must be
      `num_layers`.
  activations : `Union[Activation, List[Activation]]`, required
      The activation function to use after each `Linear` layer.  If this is a single function,
      we use it after all `Linear` layers.  If it is a `List[Activation]`,
      `len(activations)` must be `num_layers`. Activation must have torch.nn.Module type.
  dropout : `Union[float, List[float]]`, optional (default = `0.0`)
      If given, we will apply this amount of dropout after each layer.  Semantics of `float`
      versus `List[float]` is the same as with other parameters.
  
  # Examples
  
  ```python
  FeedForward(124, 2, [64, 32], torch.nn.ReLU(), 0.2)
  #> FeedForward(
  #>   (_activations): ModuleList(
  #>     (0): ReLU()
  #>     (1): ReLU()
  #>   )
  #>   (_linear_layers): ModuleList(
  #>     (0): Linear(in_features=124, out_features=64, bias=True)
  #>     (1): Linear(in_features=64, out_features=32, bias=True)
  #>   )
  #>   (_dropout): ModuleList(
  #>     (0): Dropout(p=0.2, inplace=False)
  #>     (1): Dropout(p=0.2, inplace=False)
  #>   )
  #> )
  ```
class_docstr_tok: ["This","`","Module","`","is","a","feed-forward","neural","network",",","just","a","sequence","of","`","Linear","`","layers","with","activation","functions","in","between",".","#","Parameters","input_dim",":","`","int","`",",","required","The","dimensionality","of","the","input",".","We","assume","the","input","has","shape","`","(","batch_size",",","input_dim",")","`",".","num_layers",":","`","int","`",",","required","The","number","of","`","Linear","`","layers","to","apply","to","the","input",".","hidden_dims",":","`","Union","[","int",",","List","[","int","]","]","`",",","required","The","output","dimension","of","each","of","the","`","Linear","`","layers",".","If","this","is","a","single","`","int","`",",","we","use","it","for","all","`","Linear","`","layers",".","If","it","is","a","`","List","[","int","]","`",",","`","len","(","hidden_dims",")","`","must","be","`","num_layers","`",".","activations",":","`","Union","[","Activation",",","List","[","Activation","]","]","`",",","required","The","activation","function","to","use","after","each","`","Linear","`","layer",".","If","this","is","a","single","function",",","we","use","it","after","all","`","Linear","`","layers",".","If","it","is","a","`","List","[","Activation","]","`",",","`","len","(","activations",")","`","must","be","`","num_layers","`",".","Activation","must","have","torch.nn.Module","type",".","dropout",":","`","Union","[","float",",","List","[","float","]","]","`",",","optional","(","default","=","`","0.0","`",")","If","given",",","we","will","apply","this","amount","of","dropout","after","each","layer",".","Semantics","of","`","float","`","versus","`","List","[","float","]","`","is","the","same","as","with","other","parameters",".","#","Examples","``","`","python","FeedForward","(","124",",","2",",","[","64",",","32","]",",","torch.nn.ReLU","(",")",",","0.2",")","#",">","FeedForward","(","#",">","(","_activations",")",":","ModuleList","(","#",">","(","0",")",":","ReLU","(",")","#",">","(","1",")",":","ReLU","(",")","#",">",")","#",">","(","_linear_layers",")",":","ModuleList","(","#",">","(","0",")",":","Linear","(","in_features=124",",","out_features=64",",","bias=True",")","#",">","(","1",")",":","Linear","(","in_features=64",",","out_features=32",",","bias=True",")","#",">",")","#",">","(","_dropout",")",":","ModuleList","(","#",">","(","0",")",":","Dropout","(","p=0.2",",","inplace=False",")","#",">","(","1",")",":","Dropout","(","p=0.2",",","inplace=False",")","#",">",")","#",">",")","``","`"]
code: def forward(self, inputs: torch.Tensor) -> torch.Tensor:
      output = inputs
      for layer, activation, dropout in zip(
          self._linear_layers, self._activations, self._dropout
      ):
          output = dropout(activation(layer(output)))
      return output
  
file_path: allennlp/allennlp/modules/feedforward.py
imports: from typing import List, Union
  import torch
  from allennlp.common import FromParams
  from allennlp.common.checks import ConfigurationError
  from allennlp.nn import Activation
label_desc: Use image node_id 4 for calling the FeedForward obj's underlying member method code with example usage: obj.forward(inputs) and returns: output