This module provides different metric functions. A metric can be defined by a keyword (str) or a callable. If it is a keyword it has to be available in tensorflow.keras or in deephyper.netrics. The loss functions availble in deephyper.metrics are: * Sparse Perplexity: sparse_perplexity * R2: r2 * AUC ROC: auroc * AUC Precision-Recall: aucpr

deephyper.nas.metrics.acc(y_true, y_pred)[source]
deephyper.nas.metrics.mae(y_true, y_pred)[source]
deephyper.nas.metrics.mse(y_true, y_pred)[source]
deephyper.nas.metrics.r2(y_true, y_pred)[source]
deephyper.nas.metrics.rmse(y_true, y_pred)[source]
deephyper.nas.metrics.selectMetric(name: str)[source]

Return the metric defined by name.


name (str) – a string referenced in DeepHyper, one referenced in keras or an attribute name to import.


a string suppossing it is referenced in the keras framework or a callable taking (y_true, y_pred) as inputs and returning a tensor.

Return type

str or callable

deephyper.nas.metrics.sparse_perplexity(y_true, y_pred)[source]
deephyper.nas.metrics.tfp_mae(y_true, y_pred)
deephyper.nas.metrics.tfp_mse(y_true, y_pred)
deephyper.nas.metrics.tfp_r2(y_true, y_pred)
deephyper.nas.metrics.tfp_rmse(y_true, y_pred)

Convert a regular tensorflow-keras metric for tensorflow probability where the output is a distribution.


metric_func (func) – A regular tensorflow-keras metric function.