kgcnn.metrics package

Submodules

kgcnn.metrics.metrics module

class kgcnn.metrics.metrics.AUCNoNaN(name='AUC_no_nan', **kwargs)[source]

Bases: keras.src.metrics.confusion_metrics.AUC

update_state(y_true, y_pred, sample_weight=None)[source]

Accumulates confusion matrix statistics.

Parameters
  • y_true – The ground truth values.

  • y_pred – The predicted values.

  • sample_weight – Optional weighting of each example. Can be a tensor whose rank is either 0, or the same rank as y_true, and must be broadcastable to y_true. Defaults to 1.

class kgcnn.metrics.metrics.BalancedBinaryAccuracyNoNaN(name='balanced_binary_accuracy_no_nan', class_id=None, num_thresholds=1, specificity=0.5, **kwargs)[source]

Bases: keras.src.metrics.confusion_metrics.SensitivityAtSpecificity

get_config()[source]

Return the serializable config of the metric.

result()[source]

Compute the current metric value.

Returns

A scalar tensor, or a dictionary of scalar tensors.

update_state(y_true, y_pred, sample_weight=None)[source]

Update the state of the metric.

Parameters
  • y_true – Ground truth label values. shape = [batch_size, d0, .. dN-1] or shape = [batch_size, d0, .. dN-1, 1] .

  • y_pred – The predicted probability values. shape = [batch_size, d0, .. dN] .

  • sample_weight – Optional sample_weight acts as a coefficient for the metric.

class kgcnn.metrics.metrics.BinaryAccuracyNoNaN(name='binary_accuracy_no_nan', dtype=None, threshold=0.5, **kwargs)[source]

Bases: keras.src.metrics.reduction_metrics.MeanMetricWrapper

get_config()[source]

Return the serializable config of the metric.

class kgcnn.metrics.metrics.ScaledForceMeanAbsoluteError(scaling_shape=(1, 1), name='force_mean_absolute_error', dtype_scale: Optional[str] = None, squeeze_states: bool = True, find_padded_atoms: bool = True, **kwargs)[source]

Bases: keras.src.metrics.reduction_metrics.MeanMetricWrapper

Metric for a scaled mean absolute error (MAE), which can undo a pre-scaling of the targets. Only intended as metric this allows to info the MAE with correct units or absolute values during fit.

fn_force_mae(y_true, y_pred)[source]
get_config()[source]

Returns the serializable config of the metric.

reset_state()[source]

Reset all of the metric state variables.

This function is called between epochs/steps, when a metric is evaluated during training.

set_scale(scale)[source]

Set the scale from numpy array. Usually used with broadcasting.

class kgcnn.metrics.metrics.ScaledMeanAbsoluteError(scaling_shape=(), name='mean_absolute_error', dtype_scale: Optional[str] = None, **kwargs)[source]

Bases: keras.src.metrics.regression_metrics.MeanAbsoluteError

Metric for a scaled mean absolute error (MAE), which can undo a pre-scaling of the targets. Only intended as metric this allows to info the MAE with correct units or absolute values during fit.

get_config()[source]

Returns the serializable config of the metric.

reset_state()[source]

Reset all of the metric state variables.

This function is called between epochs/steps, when a metric is evaluated during training.

set_scale(scale)[source]

Set the scale from numpy array. Usually used with broadcasting.

update_state(y_true, y_pred, sample_weight=None)[source]

Accumulate statistics for the metric.

class kgcnn.metrics.metrics.ScaledRootMeanSquaredError(scaling_shape=(), name='root_mean_squared_error', dtype_scale: Optional[str] = None, **kwargs)[source]

Bases: keras.src.metrics.regression_metrics.RootMeanSquaredError

Metric for a scaled root mean squared error (RMSE), which can undo a pre-scaling of the targets. Only intended as metric this allows to info the MAE with correct units or absolute values during fit.

get_config()[source]

Returns the serializable config of the metric.

reset_state()[source]

Reset all of the metric state variables.

This function is called between epochs/steps, when a metric is evaluated during training.

set_scale(scale)[source]

Set the scale from numpy array. Usually used with broadcasting.

update_state(y_true, y_pred, sample_weight=None)[source]

Accumulates root mean squared error statistics.

Parameters
  • y_true – The ground truth values.

  • y_pred – The predicted values.

  • sample_weight – Optional weighting of each example. Can be a Tensor whose rank is either 0, or the same rank as y_true, and must be broadcastable to y_true. Defaults to 1.

Returns

Update op.

kgcnn.metrics.utils module

kgcnn.metrics.utils.merge_metrics(m1, m2)[source]

Merge two metric lists or dicts of ks.metrics objects.

Module contents