aspire.flows.base
=================

.. py:module:: aspire.flows.base


Attributes
----------

.. autoapisummary::

   aspire.flows.base.logger


Classes
-------

.. autoapisummary::

   aspire.flows.base.Flow


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

.. py:data:: logger

.. py:class:: Flow(dims, device, data_transform = None)

   Base class for all flows.

   :param dims: The number of dimensions.
   :type dims: :py:class:`int`
   :param device: The device to use for computations. Can be None for backends that do not
                  handle devices explicitly.
   :type device: :py:class:`Any`
   :param data_transform: A transform to apply to the data before fitting the flow. If None,
                          the identity transform is used.
   :type data_transform: :py:class:`BaseTransform`, *optional*


   .. py:attribute:: xp
      :type:  Any
      :value: None



   .. py:attribute:: dims


   .. py:attribute:: device


   .. py:attribute:: data_transform
      :value: None



   .. py:method:: log_prob(x)
      :abstractmethod:



   .. py:method:: sample(n_samples)
      :abstractmethod:



   .. py:method:: sample_and_log_prob(n_samples)
      :abstractmethod:



   .. py:method:: fit(samples, **kwargs)
      :abstractmethod:



   .. py:method:: fit_data_transform(x)


   .. py:method:: rescale(x)


   .. py:method:: inverse_rescale(x)


   .. py:method:: config_dict()

      Return a dictionary of the configuration of the flow.

      This can be used to recreate the flow by passing the dictionary
      as keyword arguments to the constructor.

      This is automatically populated with the arguments passed to the
      constructor.

      :returns: **config** -- The configuration dictionary.
      :rtype: :py:class:`dict`



   .. py:method:: save(h5_file, path='flow')
      :abstractmethod:



   .. py:method:: load(h5_file, path='flow')
      :classmethod:

      :abstractmethod:



