sup3r.utilities.loss_metrics.GeothermalMohoBCLoss#

class GeothermalMohoBCLoss(heat_flow_features, moho_gradient_layer='gg_mantle_60km', upper_mantle_thermal_conductivity=4.0)[source]#

Bases: Sup3rLoss

Heat flow across Moho layer boundary condition loss

This loss enforces the Moho boundary condition described in [1]. It helps satisfy the condition that the predicted heat flow is greater than or equal to the minimum heat flow implied at the Moho layer. Predicted heat-flow features are expected in mW/m^2 and the Moho temperature-gradient input is expected in C/km.

References

Initialize the Moho boundary-condition loss.

Parameters:
  • heat_flow_features (iterable of str) – Names of predicted heat-flow features in mW/m^2.

  • moho_gradient_layer (str, optional) – Name of the true-data Moho temperature-gradient layer in C/km.

  • upper_mantle_thermal_conductivity (float, optional) – Upper-mantle thermal conductivity in W/m-K.

Methods

call(y_true, y_pred)

Invokes the Loss instance.

from_config(config)

Instantiates a Loss from its config (output of get_config()).

get_config()

Returns the config dictionary for a Loss instance.

Attributes

LOSS_METRIC

__call__(x_moho, x_gen)[source]#

Evaluate the Moho heat-flow boundary-condition loss

Parameters:
  • x_moho (tf.tensor) – Moho temperature gradient in C/km.

  • x_gen (tf.tensor) – Synthetic generator output of surface heat-flow values in mW/m^2. 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

abstract call(y_true, y_pred)#

Invokes the Loss instance.

Args:
y_true: Ground truth values. shape = [batch_size, d0, .. dN],

except sparse loss functions such as sparse categorical crossentropy where shape = [batch_size, d0, .. dN-1]

y_pred: The predicted values. shape = [batch_size, d0, .. dN]

Returns:

Loss values with the shape [batch_size, d0, .. dN-1].

classmethod from_config(config)#

Instantiates a Loss from its config (output of get_config()).

Args:

config: Output of get_config().

Returns:

A Loss instance.

get_config()#

Returns the config dictionary for a Loss instance.