foolbox.utils

foolbox.utils.softmax(logits)[source]

Transforms predictions into probability values.

Parameters:

logits : array_like

The logits predicted by the model.

Returns:

numpy.ndarray

Probability values corresponding to the logits.

foolbox.utils.crossentropy(label, logits)[source]

Calculates the cross-entropy.

Parameters:

logits : array_like

The logits predicted by the model.

label : int

The label describing the target distribution.

Returns:

float

The cross-entropy between softmax(logits) and onehot(label).