credit.postblock.exp
====================

.. py:module:: credit.postblock.exp


Classes
-------

.. autoapisummary::

   credit.postblock.exp.ExpTransform


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

.. py:class:: ExpTransform(variables: list[str], eps: float = 1e-08, base: str = 'e', key: str = 'y_processed')

   Bases: :py:obj:`credit.postblock.base.BasePostblock`


   Inverse of the LogTransform preblock: converts log-space values to physical space.

   Inverts ``y = log_base(x + eps) - log_base(eps)`` back to ``x = base^(y + log_base(eps)) - eps``.

   ``eps`` and ``base`` must match those used in the corresponding LogTransform preblock.

   ``variables`` supports the same shorthand as the scaler: an empty list
   transforms every variable; partial paths (e.g. ``"era5/prognostic"``) expand
   to all variables under that hierarchy. Expansion happens lazily on the first
   forward call.

   Config example::

       type: "exp_transform"
       args:
           variables:
               - "era5/prognostic/3d/Q"
           eps: 1.0e-8      # must match LogTransform eps
           base: "e"        # must match LogTransform base

       # or inverse-transform all variables:
       type: "exp_transform"
       args:
           variables: []


   .. py:attribute:: variables


   .. py:attribute:: variables_expanded
      :value: False



   .. py:attribute:: key
      :value: 'y_processed'



   .. py:attribute:: _eps


   .. py:attribute:: _base
      :value: 'e'



   .. py:method:: _exp(x: torch.Tensor) -> torch.Tensor

      Apply base-specific exponentiation: e^x, 2^x, or 10^x.



   .. py:method:: forward(batch_dict: dict) -> dict


