sup3r.utilities.loss_metrics.GeothermalPositiveTemperatureGradientLoss#
- class GeothermalPositiveTemperatureGradientLoss(depths=range(0, 8000, 1000), temperature_prefix='t')[source]#
Bases:
Sup3rLossPositive geothermal gradient loss
This loss applies the positive-gradient regularization described in [1]. It penalizes negative vertical temperature gradients so predicted temperature increases with depth. Temperature features are expected in C and named
<temperature_prefix>_<depth>m(e.g. “t_2000m”).References
Initialize the positive temperature-gradient loss
- Parameters:
depths (iterable of int, optional) – Depth levels in m used to assemble temperature channels. At least two depths are required.
temperature_prefix (str, optional) – Prefix used for temperature channels in C. Expected feature names are
<temperature_prefix>_<depth>m.
Methods
call(__, x_gen)Evaluate the positive temperature-gradient loss
from_config(config)get_config()Attributes
LOSS_METRICdtype- call(__, x_gen)[source]#
Evaluate the positive temperature-gradient loss
- Parameters:
x_true (tf.tensor) – Ground truth data (unused).
x_gen (tf.tensor) – Synthetic generator output used to compute vertical temperature gradients. The feature axis must contain temperature channels in C. Shape must be either: (n_observations, spatial_1, spatial_2, features) or (n_observations, spatial_1, spatial_2, temporal, features)
- Returns:
tf.tensor – 0D tensor loss value
- __call__(y_true, y_pred, sample_weight=None)#
Call self as a function.