crested.tl.metrics.SpearmanCorrelationPerClass#

class crested.tl.metrics.SpearmanCorrelationPerClass(num_classes, name='multiclass_spearman_correlation', **kwargs)#

Spearman correlation metric for multiclass models.

Attributes table#

Methods table#

add_variable(shape, initializer[, dtype, ...])

add_weight([shape, initializer, dtype, name])

from_config(config)

get_config()

Return the serializable config of the metric.

reset_state()

Reset the state of the metric.

result()

Calculate the result of the metric.

stateless_reset_state()

stateless_result(metric_variables)

stateless_update_state(metric_variables, ...)

update_state(y_true, y_pred[, sample_weight])

Update the state of the metric.

Attributes#

SpearmanCorrelationPerClass.dtype#
SpearmanCorrelationPerClass.variables#

Methods#

SpearmanCorrelationPerClass.add_variable(shape, initializer, dtype=None, aggregation='sum', name=None)#
SpearmanCorrelationPerClass.add_weight(shape=(), initializer=None, dtype=None, name=None)#
classmethod SpearmanCorrelationPerClass.from_config(config)#
SpearmanCorrelationPerClass.get_config()#

Return the serializable config of the metric.

SpearmanCorrelationPerClass.reset_state()#

Reset the state of the metric.

SpearmanCorrelationPerClass.result()#

Calculate the result of the metric.

SpearmanCorrelationPerClass.stateless_reset_state()#
SpearmanCorrelationPerClass.stateless_result(metric_variables)#
SpearmanCorrelationPerClass.stateless_update_state(metric_variables, *args, **kwargs)#
SpearmanCorrelationPerClass.update_state(y_true, y_pred, sample_weight=None)#

Update the state of the metric.

Args:

y_true (tensor): Ground truth labels of shape (batch_size, num_classes). y_pred (tensor): Predicted outputs of shape (batch_size, num_classes).