credit.losses.downscaling_loss
==============================

.. py:module:: credit.losses.downscaling_loss


Attributes
----------

.. autoapisummary::

   credit.losses.downscaling_loss.logger


Classes
-------

.. autoapisummary::

   credit.losses.downscaling_loss.DownscalingLoss


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

.. py:data:: logger

.. py:class:: DownscalingLoss(conf, validation=False)

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


   Custom loss function for downscaling.

   :param conf: configuration dictionary containing loss function
                settings and weights.
   :type conf: dict
   :param validation: whether loss function is in validation
                      mode.  Defaults to False.
   :type validation: bool, optional


   .. py:attribute:: training_loss


   .. py:attribute:: use_power_loss


   .. py:attribute:: use_spectral_loss


   .. py:attribute:: spectral_lambda_reg


   .. py:attribute:: spectral_wavenum_init


   .. py:attribute:: validation
      :value: False



   .. py:method:: forward(target, pred)

      Calculate the total loss for the given target and prediction.

      This method computes the base loss between the target and
      prediction, applies optional variable weights, and optionally
      adds spectral and power loss components.

      :param target: Ground truth tensor.
      :type target: torch.Tensor
      :param pred: Predicted tensor.
      :type pred: torch.Tensor

      :returns: The computed loss value.
      :rtype: torch.Tensor



