class_docstr: Standard Multi-Layer Perceptron; also known as a feed-forward network.
  
  !!! faq
  
      If you get a TypeError saying an object is not a valid JAX type, see the
          [FAQ](https://docs.kidger.site/equinox/faq/).
docstr: **Arguments:**
  
  - `x`: A JAX array with shape `(in_size,)`. (Or shape `()` if
      `in_size="scalar"`.)
  - `key`: Ignored; provided for compatibility with the rest of the Equinox API.
      (Keyword only argument.)
  
  **Returns:**
  
  A JAX array with shape `(out_size,)`. (Or shape `()` if `out_size="scalar"`.)
docstr_tok: ["*","*","Arguments",":","*","*","-","`","x","`",":","A","JAX","array","with","shape","`","(","in_size",",",")","`",".","(","Or","shape","`","(",")","`","if","`","in_size=","''","scalar","''","`",".",")","-","`","key","`",":","Ignored",";","provided","for","compatibility","with","the","rest","of","the","Equinox","API",".","(","Keyword","only","argument",".",")","*","*","Returns",":","*","*","A","JAX","array","with","shape","`","(","out_size",",",")","`",".","(","Or","shape","`","(",")","`","if","`","out_size=","''","scalar","''","`",".",")"]
code: def __call__(
      self, x: Array, *, key: Optional[PRNGKeyArray] = None
  ) -> Array:
      """**Arguments:**
  
      - `x`: A JAX array with shape `(in_size,)`. (Or shape `()` if
          `in_size="scalar"`.)
      - `key`: Ignored; provided for compatibility with the rest of the Equinox API.
          (Keyword only argument.)
  
      **Returns:**
  
      A JAX array with shape `(out_size,)`. (Or shape `()` if `out_size="scalar"`.)
      """
      for i, layer in enumerate(self.layers[:-1]):
          x = layer(x)
          layer_activation = jtu.tree_map(
              lambda x: x[i] if is_array(x) else x, self.activation
          )
          x = filter_vmap(lambda a, b: a(b))(layer_activation, x)
      x = self.layers[-1](x)
      if self.out_size == "scalar":
          x = self.final_activation(x)
      else:
          x = filter_vmap(lambda a, b: a(b))(self.final_activation, x)
      return x
  
file_path: equinox/equinox/nn/_mlp.py
imports: from collections.abc import Callable
  from typing import Literal, Optional, Union
  import jax
  import jax.nn
  import jax.random
  import jax.tree_util
  from jaxtyping import Array, PRNGKeyArray
  from .._doc_utils import doc_repr
  from .._filters import is_array
  from .._module import field, Module
  from .._vmap_pmap import filter_vmap
  from ._linear import Linear
label_desc: Use image node_id 2 for calling the MLP obj's underlying member method code with example usage: obj.__call__(x) and returns: x