ytm.guided.backends.act_loss.ActLoss#
- class ytm.guided.backends.act_loss.ActLoss#
Bases:
objectBase class for an output activation paired with a loss.
A subclass sets
act("softmax","sigmoid"or"identity") andsrc, the C source ofcompute_loss(y, y_hat, grad, loss). Given targetsyand activationsy_hatfor one sample, it writes the summed loss tolossand, per class, the negative gradient of the loss with respect to the pre-activation tograd. Either pointer can be NULL, then that output is skipped.