class_docstr: Simple feedforward MLP torso with initial layer-norm.
  
  This module is an MLP which uses LayerNorm (with a tanh normalizer) on the
  first layer and non-linearities (elu) on all but the last remaining layers.
docstr: Construct the MLP.
  
  Args:
    layer_sizes: a sequence of ints specifying the size of each layer.
    w_init: initializer for Linear weights.
    activation: activation function to apply between linear layers. Defaults
      to ELU. Note! This is different from snt.nets.MLP's default.
    activate_final: whether or not to use the activation function on the final
      layer of the neural network.
docstr_tok: ["Construct","the","MLP",".","Args",":","layer_sizes",":","a","sequence","of","ints","specifying","the","size","of","each","layer",".","w_init",":","initializer","for","Linear","weights",".","activation",":","activation","function","to","apply","between","linear","layers",".","Defaults","to","ELU",".","Note","!","This","is","different","from","snt.nets.MLP","'s","default",".","activate_final",":","whether","or","not","to","use","the","activation","function","on","the","final","layer","of","the","neural","network","."]
code: def __init__(
      self,
      layer_sizes: Sequence[int],
      w_init: Optional[snt.initializers.Initializer] = None,
      activation: Callable[[tf.Tensor], tf.Tensor] = tf.nn.elu,
      activate_final: bool = False,
  ):
      """Construct the MLP.
  
      Args:
        layer_sizes: a sequence of ints specifying the size of each layer.
        w_init: initializer for Linear weights.
        activation: activation function to apply between linear layers. Defaults
          to ELU. Note! This is different from snt.nets.MLP's default.
        activate_final: whether or not to use the activation function on the final
          layer of the neural network.
      """
      super().__init__(name="feedforward_mlp_torso")
  
      self._network = snt.Sequential(
          [
              snt.Linear(
                  layer_sizes[0],
                  w_init=w_init or _uniform_initializer(),
              ),
              snt.LayerNorm(
                  axis=slice(1, None),
                  create_scale=True,
                  create_offset=True,
              ),
              tf.nn.tanh,
              snt.nets.MLP(
                  layer_sizes[1:],
                  w_init=w_init or _uniform_initializer(),
                  activation=activation,
                  activate_final=activate_final,
              ),
          ]
      )
  
imports: from typing import Callable, Optional, Sequence
  from acme import types
  from acme.tf import utils
  from acme.tf.networks import base
  import sonnet
  import tensorflow
label_desc: Use image node_id 1 to create a new LayerNormMLP object from inherited base classes: snt with example: obj = LayerNormMLP(layer_sizes, w_init, activation, activate_final)