credit.losses.logcosh
=====================

.. py:module:: credit.losses.logcosh


Classes
-------

.. autoapisummary::

   credit.losses.logcosh.LogCoshLoss


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

.. py:class:: LogCoshLoss(reduction='mean')

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


   Log-Cosh Loss Function.

   This loss function computes the logarithm of the hyperbolic cosine of the
   prediction error. It is less sensitive to outliers compared to the Mean
   Squared Error (MSE) loss.

   :param reduction: Specifies the reduction to apply to the output.
                     'mean' | 'none'. 'mean': the output is averaged; 'none': no reduction is applied.
   :type reduction: str


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



   .. py:method:: forward(y_t, y_prime_t)

      Forward pass for Log-Cosh loss.

      :param y_t: Target tensor.
      :type y_t: torch.Tensor
      :param y_prime_t: Predicted tensor.
      :type y_prime_t: torch.Tensor

      :returns: Log-Cosh loss value.
      :rtype: torch.Tensor



