Loss-Guided TM#

Models#

MultiClassTM(n_clauses, s, dim, n_classes, **opt)

Guided TM for multi-class classification: each sample has exactly one of n_classes classes.

MultiOutputTM(n_clauses, s, dim, n_classes, ...)

Guided TM for multi-label classification: each sample can have any number of n_classes labels.

BinaryTM(n_clauses, s, dim, **opt)

Guided TM for binary classification: one output, each sample is 0 or 1.

RegressionTM(n_clauses, s, dim, **opt)

Guided TM for regression: one real-valued target per sample.

Configuration#

TMConfig()

Settings for the guided TM models.

ActFn(*values)

FbSignal(*values)

Activations and losses#

ActLoss()

Base class for an output activation paired with a loss.

SoftmaxCE([eps, weights])

Softmax with cross-entropy, for single-label classification.

SigmoidBCE([eps, pos_weights, neg_weights])

Sigmoid with binary cross-entropy per class, for binary and multi-label classification.

MSE()

Identity with squared error, for regression.

MAE()

Identity with absolute error, for regression.

Huber([delta])

Identity with Huber loss, for regression.

ASL([gamma_pos, gamma_neg, clip, eps])

Sigmoid with asymmetric loss, for multi-label classification with many negatives.

SCE([alpha, beta, eps, eps_hat])

Softmax with symmetric cross-entropy (cross-entropy plus reverse cross-entropy), for noisy labels.

Tversky([alpha, beta, eps])

Sigmoid with Tversky loss over the classes of a sample, for multi-label classification.

FocalBCE([alpha, gamma, eps])

Sigmoid with focal binary cross-entropy per class, for imbalanced binary and multi-label classification.

FocalCE([alpha, gamma, eps])

Softmax with focal cross-entropy, for imbalanced single-label classification.