UQ_KERAS_UTILS

UQ_KERAS_UTILS#

uq_keras_utils.AbstentionAdapt_Callback(...)

This callback is used to adapt the parameter alpha in the abstention loss.

uq_keras_utils.Contamination_Callback(x, y)

This callback is used to update the parameters of the contamination model.

uq_keras_utils.abstention_loss(alpha, mask)

Function to compute abstention loss.

uq_keras_utils.sparse_abstention_loss(alpha, ...)

Function to compute abstention loss.

uq_keras_utils.abstention_acc_metric(nb_classes)

Abstained accuracy: Function to estimate accuracy over the predicted samples after removing the samples where the model is abstaining.

uq_keras_utils.sparse_abstention_acc_metric(...)

Abstained accuracy: Function to estimate accuracy over the predicted samples after removing the samples where the model is abstaining.

uq_keras_utils.abstention_metric(nb_classes)

Function to estimate fraction of the samples where the model is abstaining.

uq_keras_utils.acc_class_i_metric(class_i)

Function to estimate accuracy over the ith class prediction.

uq_keras_utils.abstention_acc_class_i_metric(...)

Function to estimate accuracy over the class i prediction after removing the samples where the model is abstaining.

uq_keras_utils.abstention_class_i_metric(...)

Function to estimate fraction of the samples where the model is abstaining in class i.

uq_keras_utils.modify_labels(numclasses_out, ...)

This function generates a categorical representation with a class added for indicating abstention.

uq_keras_utils.add_model_output(modelIn[, ...])

This function modifies the last dense layer in the passed Keras model.

uq_keras_utils.r2_heteroscedastic_metric(nout)

This function computes the r2 for the heteroscedastic model.

uq_keras_utils.mae_heteroscedastic_metric(nout)

This function computes the mean absolute error (mae) for the heteroscedastic model.

uq_keras_utils.mse_heteroscedastic_metric(nout)

This function computes the mean squared error (mse) for the heteroscedastic model.

uq_keras_utils.meanS_heteroscedastic_metric(nout)

This function computes the mean log of the variance (log S) for the heteroscedastic model.

uq_keras_utils.heteroscedastic_loss(nout)

This function computes the heteroscedastic loss for the heteroscedastic model.

uq_keras_utils.quantile_loss(quantile, ...)

This function computes the quantile loss for a given quantile fraction.

uq_keras_utils.triple_quantile_loss(nout, ...)

This function computes the quantile loss for the median and low and high quantiles.

uq_keras_utils.quantile_metric(nout, index, ...)

This function computes the quantile metric for a given quantile and corresponding output index.

uq_keras_utils.add_index_to_output(y_train)

This function adds a column to the training output to store the indices of the corresponding samples in the training set.

uq_keras_utils.contamination_loss(nout, T_k, ...)

Function to compute contamination loss.

uq_keras_utils.mse_contamination_metric(nout)

This function computes the mean squared error (mse) for the contamination model.

uq_keras_utils.mae_contamination_metric(nout)

This function computes the mean absolute error (mae) for the contamination model.

uq_keras_utils.r2_contamination_metric(nout)

This function computes the r2 for the contamination model.