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``
      The dimensionality of the input.  We assume the input has shape ``(batch_size, input_dim)``.
  num_layers : ``int``
      The number of ``Linear`` layers to apply to the input.
  hidden_dims : ``Union[int, Sequence[int]]``
      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 ``Sequence[int]``, ``len(hidden_dims)`` must be
      ``num_layers``.
  activations : ``Union[Callable, Sequence[Callable]]``
      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 ``Sequence[Callable]``,
      ``len(activations)`` must be ``num_layers``.
  dropout : ``Union[float, Sequence[float]]``, optional
      If given, we will apply this amount of dropout after each layer.  Semantics of ``float``
      versus ``Sequence[float]`` is the same as with other parameters.
code: def from_params(cls, params):
      input_dim = params.pop_int("input_dim")
      num_layers = params.pop_int("num_layers")
      hidden_dims = params.pop("hidden_dims")
      activations = params.pop("activations")
      dropout = params.pop("dropout", 0.0)
      if isinstance(activations, list):
          activations = [
              Activation.by_name(name)() for name in activations
          ]
      else:
          activations = Activation.by_name(activations)()
      params.assert_empty(cls.__name__)
      return cls(
          input_dim=input_dim,
          num_layers=num_layers,
          hidden_dims=hidden_dims,
          activations=activations,
          dropout=dropout,
      )
  
file_path: magnitude/pymagnitude/third_party/allennlp/modules/feedforward.py
imports: from __future__ import absolute_import
  import torch
  from allennlp.common import Params
  from allennlp.common.checks import ConfigurationError
  from allennlp.nn import Activation
label_desc: Use image node_id 5 for calling the FeedForward obj's underlying member method code with example usage: obj.from_params(cls, params) and returns: cls