nessai.flows.nets
=================

.. py:module:: nessai.flows.nets

.. autoapi-nested-parse::

   Neural networks for use in flows.

   ..
       !! processed by numpydoc !!


Classes
-------

.. autoapisummary::

   nessai.flows.nets.MLP


Module Contents
---------------

.. py:class:: MLP(in_shape, out_shape, hidden_sizes, activation=F.relu, activate_output=False, dropout_probability=0.0)

   Bases: :py:obj:`torch.nn.Module`


   
   A standard multi-layer perceptron.

   Based on the implementation in nflows and modified to include dropout and
   conditional inputs.

   :Parameters:

       **in_shape** : tuple
           Input shape.

       **out_shape** : tuple
           Output shape.

       **hidden_sizes** : List[int]
           Number of neurons in the hidden layers.

       **activation** : Callable
           Activation function

       **activate_output** : Union[bool, Callable]
           Whether to activate the output layer. If a bool is specified the same
           activation function is used. If a callable inputs is specified, it
           will be used for the activation.

       **dropout_probability** : float
           Amount of dropout to apply after the hidden layers.














   ..
       !! processed by numpydoc !!

   .. py:method:: forward(inputs, context=None)

      
      Forward method that allows for kwargs such as context.


      :Parameters:

          **inputs** : :obj:`torch.tensor`
              Inputs to the MLP

          **context** : None
              Conditional inputs, must be None. Only implemented to the
              function is compatible with other methods.







      :Raises:

          ValueError
              If the context is not None.

          ValueError
              If the input shape is incorrect.







      ..
          !! processed by numpydoc !!


