credit.losses.covariance
========================

.. py:module:: credit.losses.covariance


Attributes
----------

.. autoapisummary::

   credit.losses.covariance.reduction_functions


Classes
-------

.. autoapisummary::

   credit.losses.covariance.CovarianceWeightedMSELoss


Functions
---------

.. autoapisummary::

   credit.losses.covariance.passthrough


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

.. py:function:: passthrough(in_val)

.. py:data:: reduction_functions

.. py:class:: CovarianceWeightedMSELoss(reduction: str = 'mean', batch_normalize: bool = False, off_diagonal_scale: float = 1.0, **kwargs)

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


   Mean Squared Error weighted by the error covariance matrix across variables, levels and output times.
   Assumes input Tensors have shape (batch, variable, time, lat, lon).

   :param reduction: one of mean, none, sum, min, max
   :type reduction: str
   :param batch_normalize: If true, normalize each variable by the y_true batch means and standard devs.
   :type batch_normalize: bool


   .. py:attribute:: reduction
      :value: 'mean'



   .. py:attribute:: reduction_function


   .. py:attribute:: batch_normalize
      :value: False



   .. py:attribute:: off_diagonal_scale
      :value: 1.0



   .. py:method:: forward(y_true, y_pred)


