+
    åûjÕ  ã                  ót   € ^ RI Ht ^ RIt^ RIHt ^ RIHt ^ RIHt R R lt ! R R	]P                  4      t
R# )
é    )ÚannotationsN)Únn)Úmetrics)Ú_PSNRMaxValc               ó(   € V ^8„  d   QhRRRRRRRR/# )é   Úimageútorch.TensorÚtargetÚmax_valr   Úreturn© )Úformats   "ÚNC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\losses\psnr.pyÚ__annotate__r      s)   € ÷ 7ñ 7�\ð 7¨<ð 7À+ð 7ÐR^ñ 7ó    c                ó>   € R\         P                  ! WV4      ,          # )at  Compute the PSNR loss, the negative PSNR of two images.

``loss = psnr_loss(image, target, max_val)`` is ``-psnr(image, target, max_val)``, so minimising it raises
the PSNR.

Convention:
    See the Convention block of :func:`~kornia.metrics.psnr`: the MSE is pooled over the batch, and identical
    inputs give ``-inf``.

Args:
    image: image with shape ``(*)``.
    target: target with the same shape as ``image``.
    max_val: data range :math:`\text{MAX}_I` of the images, as a float, integer or tensor.

Returns:
    the loss, a scalar for a scalar range or with the shape of a tensor range.

See Also:
    - :class:`~kornia.losses.PSNRLoss`: the module form.
    - :func:`~kornia.metrics.psnr`: the PSNR itself, with the opposite sign.

Examples:
    >>> ones = torch.ones(1)
    >>> psnr_loss(ones, 1.2 * ones, 2.) # 10 * log(4/((1.2-1)**2)) / log(10)
    tensor(-20.0000)

g      ð¿)r   Úpsnr)r	   r   r   s   &&&r   Ú	psnr_lossr      s   € ð8 ”'—,’,˜u¨gÓ6Õ6Ð6r   c                  ó>   a € ] tR t^:tRtR V 3R lltR R ltRtV ;t# )ÚPSNRLossaN  Compute the PSNR loss, the negative PSNR of two images (module form).

``criterion = PSNRLoss(max_val)`` stores ``max_val``, and ``loss = criterion(image, target)`` is
:func:`~kornia.losses.psnr_loss`.

Convention:
    See the Convention block of :func:`~kornia.losses.psnr_loss`.

Args:
    max_val: data range :math:`\text{MAX}_I` of the images, as a float, integer or tensor.

Shape:
    - Image: ``(*)``.
    - Target: ``(*)``, the shape of the image.
    - Output: a scalar for a scalar range, or the shape of a tensor range.

See Also:
    - :func:`~kornia.losses.psnr_loss`: the one-call form.
    - :func:`~kornia.metrics.psnr`: the PSNR itself, with the opposite sign.

Examples:
    >>> ones = torch.ones(1)
    >>> criterion = PSNRLoss(2.)
    >>> criterion(ones, 1.2 * ones) # 10 * log(4/((1.2-1)**2)) / log(10)
    tensor(-20.0000)

c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   ÚNoner   )r   s   "r   r   ÚPSNRLoss.__annotate__W   s   € ÷ ,ñ , ð ,°ñ ,r   c                	ó0   <€ \         SV `  4        Wn        R # )N)ÚsuperÚ__init__r   )Úselfr   Ú	__class__s   &&€r   r   ÚPSNRLoss.__init__W   s   ø€ Ü‰ÑÔØ$+Žr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r	   r
   r   r   r   )r   s   "r   r   r   [   s!   € ÷ 6ñ 6˜\ð 6°<ð 6ÀLñ 6r   c                ó.   € \        WV P                  4      # )aV  Compute the negative PSNR loss between two tensors.

Args:
    image: Predicted image or signal tensor with arbitrary shape.
    target: Reference tensor with the same shape as ``image``.

Returns:
    Tensor containing the PSNR-based loss computed with
    ``self.max_val``. Lower values correspond to higher peak signal to
    noise ratio.
)r   r   )r   r	   r   s   &&&r   ÚforwardÚPSNRLoss.forward[   s   € ô ˜¨¯©Ó5Ð5r   )r   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r#   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r   :   s   ø† ñ÷8,ð ,÷6ó 6r   r   )Ú
__future__r   Útorchr   Úkorniar   Úkornia.metrics.psnrr   r   ÚModuler   r   r   r   Ú<module>r1      s+   ðõ$ #ã Ý å Ý +õ7ô>-6ˆr�y‰yö -6r   