mighty.monitor.accuracy.AccuracyArgmax

class mighty.monitor.accuracy.AccuracyArgmax[source]

Softmax accuracy.

The predicted labels are simply output.argmax(dim=-1).

Methods

__init__()

extra_repr()

partial_fit(outputs_batch, labels_batch)

If the accuracy measure is not argmax (if the model's last layer isn't a softmax), the output is an embedding vector, which has to be stored and retrieved at prediction.

predict(outputs_test)

Predict the labels, given model output.

predict_proba(outputs_test)

Compute label probabilities, given model output.

reset()

Resets all cached predicted and ground truth data.

reset_labels()

Resets predicted and ground truth labels.

partial_fit(outputs_batch, labels_batch)[source]

If the accuracy measure is not argmax (if the model’s last layer isn’t a softmax), the output is an embedding vector, which has to be stored and retrieved at prediction.

Parameters:
outputs_batchtorch.Tensor or tuple

The output of a model.

labels_batchtorch.Tensor

True labels.

predict(outputs_test)[source]

Predict the labels, given model output.

Parameters:
outputs_testtorch.Tensor or tuple

The output of a model.

Returns:
torch.Tensor

Predicted labels.

predict_proba(outputs_test)[source]

Compute label probabilities, given model output.

Parameters:
outputs_testtorch.Tensor or tuple

The output of a model.

Returns:
torch.Tensor

The probabilities of assigning to each class of shape (., C), where C is the number of classes.

reset()

Resets all cached predicted and ground truth data.

reset_labels()

Resets predicted and ground truth labels.