Losses#
Sparsity objectives minimized during training.
Loss functions for sparse basis training.
Mirror of upstream src/loss.jl. loss_function is the loss of one image;
basis_loss and mean_loss are the closures over a basis that the trainers
differentiate.
Contents
L1 norm loss: minimizes |
|
MSE loss with top-k truncation: |
|
Marker protocol for loss types. |
|
Compute scalar loss for a single image under the given circuit. |
|
|
|
|
|
Keep the k coefficients with largest absolute value; zero the rest. |