:py:mod:`IMLCV.implementations.CvDiscovery`
===========================================

.. py:module:: IMLCV.implementations.CvDiscovery


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

Classes
~~~~~~~

.. autoapisummary::

   IMLCV.implementations.CvDiscovery.Encoder
   IMLCV.implementations.CvDiscovery.Decoder
   IMLCV.implementations.CvDiscovery.VAE
   IMLCV.implementations.CvDiscovery.TranformerAutoEncoder
   IMLCV.implementations.CvDiscovery.TransoformerLDA




.. py:class:: Encoder

   Bases: :py:obj:`flax.linen.Module`

   Base class for all neural network modules. Layers and models should subclass this class.

   All Flax Modules are Python 3.7
   `dataclasses <https://docs.python.org/3/library/dataclasses.html>`_. Since
   dataclasses take over ``__init__``, you should instead override :meth:`setup`,
   which is automatically called to initialize the module.

   Modules can contain submodules, and in this way can be nested in a tree
   structure. Submodels can be assigned as regular attributes inside the
   :meth:`setup` method.

   You can define arbitrary "forward pass" methods on your Module subclass.
   While no methods are special-cased, ``__call__`` is a popular choice because
   it allows you to use module instances as if they are functions::

     from flax import linen as nn

     class Module(nn.Module):
       features: Tuple[int, ...] = (16, 4)

       def setup(self):
         self.dense1 = Dense(self.features[0])
         self.dense2 = Dense(self.features[1])

       def __call__(self, x):
         return self.dense2(nn.relu(self.dense1(x)))

   Optionally, for more concise module implementations where submodules
   definitions are co-located with their usage, you can use the
   :meth:`compact` wrapper.

   .. py:attribute:: latents
      :type: int

      

   .. py:attribute:: layers
      :type: int

      

   .. py:attribute:: nunits
      :type: int

      

   .. py:attribute:: dim
      :type: int

      

   .. py:method:: __call__(x)



.. py:class:: Decoder

   Bases: :py:obj:`flax.linen.Module`

   Base class for all neural network modules. Layers and models should subclass this class.

   All Flax Modules are Python 3.7
   `dataclasses <https://docs.python.org/3/library/dataclasses.html>`_. Since
   dataclasses take over ``__init__``, you should instead override :meth:`setup`,
   which is automatically called to initialize the module.

   Modules can contain submodules, and in this way can be nested in a tree
   structure. Submodels can be assigned as regular attributes inside the
   :meth:`setup` method.

   You can define arbitrary "forward pass" methods on your Module subclass.
   While no methods are special-cased, ``__call__`` is a popular choice because
   it allows you to use module instances as if they are functions::

     from flax import linen as nn

     class Module(nn.Module):
       features: Tuple[int, ...] = (16, 4)

       def setup(self):
         self.dense1 = Dense(self.features[0])
         self.dense2 = Dense(self.features[1])

       def __call__(self, x):
         return self.dense2(nn.relu(self.dense1(x)))

   Optionally, for more concise module implementations where submodules
   definitions are co-located with their usage, you can use the
   :meth:`compact` wrapper.

   .. py:attribute:: latents
      :type: int

      

   .. py:attribute:: layers
      :type: int

      

   .. py:attribute:: nunits
      :type: int

      

   .. py:attribute:: dim
      :type: int

      

   .. py:method:: __call__(z)



.. py:class:: VAE

   Bases: :py:obj:`flax.linen.Module`

   Base class for all neural network modules. Layers and models should subclass this class.

   All Flax Modules are Python 3.7
   `dataclasses <https://docs.python.org/3/library/dataclasses.html>`_. Since
   dataclasses take over ``__init__``, you should instead override :meth:`setup`,
   which is automatically called to initialize the module.

   Modules can contain submodules, and in this way can be nested in a tree
   structure. Submodels can be assigned as regular attributes inside the
   :meth:`setup` method.

   You can define arbitrary "forward pass" methods on your Module subclass.
   While no methods are special-cased, ``__call__`` is a popular choice because
   it allows you to use module instances as if they are functions::

     from flax import linen as nn

     class Module(nn.Module):
       features: Tuple[int, ...] = (16, 4)

       def setup(self):
         self.dense1 = Dense(self.features[0])
         self.dense2 = Dense(self.features[1])

       def __call__(self, x):
         return self.dense2(nn.relu(self.dense1(x)))

   Optionally, for more concise module implementations where submodules
   definitions are co-located with their usage, you can use the
   :meth:`compact` wrapper.

   .. py:attribute:: latents
      :type: int

      

   .. py:attribute:: layers
      :type: int

      

   .. py:attribute:: nunits
      :type: int

      

   .. py:attribute:: dim
      :type: int

      

   .. py:method:: setup()

      Initializes a Module lazily (similar to a lazy ``__init__``).

      ``setup`` is called once lazily on a module instance when a module
      is bound, immediately before any other methods like ``__call__`` are
      invoked, or before a ``setup``-defined attribute on `self` is accessed.

      This can happen in three cases:

        1. Immediately when invoking :meth:`apply`, :meth:`init` or
           :meth:`init_and_output`.

        2. Once the module is given a name by being assigned to an attribute of
           another module inside the other module's ``setup`` method
           (see :meth:`__setattr__`)::

             class MyModule(nn.Module):
               def setup(self):
                 submodule = Conv(...)

                 # Accessing `submodule` attributes does not yet work here.

                 # The following line invokes `self.__setattr__`, which gives
                 # `submodule` the name "conv1".
                 self.conv1 = submodule

                 # Accessing `submodule` attributes or methods is now safe and
                 # either causes setup() to be called once.

        3. Once a module is constructed inside a method wrapped with
           :meth:`compact`, immediately before another method is called or
           ``setup`` defined attribute is accessed.


   .. py:method:: __call__(x, z_rng)


   .. py:method:: encode(x)


   .. py:method:: reparameterize(rng, mean, logvar)
      :classmethod:



.. py:class:: TranformerAutoEncoder(outdim, periodicity=None, bounding_box=None, descriptor='sb', descriptor_kwargs={})

   Bases: :py:obj:`IMLCV.base.CVDiscovery.Transformer`

   .. py:method:: _fit(cv: list[IMLCV.base.CV.CV], nl: list[NeighbourList] | None, nunits=250, nlayers=3, lr=0.0001, num_epochs=100, batch_size=32, **kwargs)



.. py:class:: TransoformerLDA(outdim, periodicity=None, bounding_box=None, descriptor='sb', descriptor_kwargs={})

   Bases: :py:obj:`IMLCV.base.CVDiscovery.Transformer`

   .. py:method:: _fit(cv_list: list[IMLCV.base.CV.CV], nl_list: list[NeighbourList] | None, kernel=False, harmonic=True, sort='rematch', shrinkage=0, alpha_rematch=0.1, max_iterations=50, **kwargs)



