delta.model.class_weighted_categorical_crossentropy

delta.model.class_weighted_categorical_crossentropy(class_weights: Union[List[float], Tuple[float, ...]]) Callable[[Tensor, Tensor], float]

Generate class-weighted categorical cross-entropy loss function. The code is adapted from the Keras TF backend. (see their github)

Parameters
class_weightstuple/list of floats

Weights for each class/category.

Returns
function.

Class-weighted categorical cross-entropy loss function.