credit.models.wxformer.stochastic_decomposition_layer
=====================================================

.. py:module:: credit.models.wxformer.stochastic_decomposition_layer


Classes
-------

.. autoapisummary::

   credit.models.wxformer.stochastic_decomposition_layer.StochasticDecompositionLayer


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

.. py:class:: StochasticDecompositionLayer(noise_dim, feature_channels, noise_factor=0.1)

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


   A module that injects noise into feature maps, with a per-pixel and per-channel style modulation.

   .. attribute:: noise_transform

      A linear transformation to map latent noise to the feature map's channels.

      :type: nn.Linear

   .. attribute:: modulation

      A learnable scaling factor applied to the noise.

      :type: nn.Parameter

   .. attribute:: noise_factor

      A scaling factor for controlling the intensity of the injected noise.

      :type: float

   .. method:: forward(feature_map, noise)

      Adds noise to the feature map, modulated by style and the modulation parameter.
      


   .. py:attribute:: noise_transform


   .. py:attribute:: modulation


   .. py:attribute:: noise_factor


   .. py:method:: forward(feature_map, noise)

      Injects noise into the feature map.

      :param feature_map: The input feature map (batch, channels, height, width).
      :type feature_map: torch.Tensor
      :param noise: The latent noise tensor (batch, noise_dim), used for modulating the injected noise.
      :type noise: torch.Tensor

      :returns: The feature map with injected noise.
      :rtype: torch.Tensor



