Open
Description
Is it possible to declare layer-associated losses, as per tensorflow? In the TF2 API, layers can be declared with optional weight and activation losses. It also provides some standard loss functions including L1 and L2. During training, as well as collecting the parameters, it collects the losses. Perhaps there would be some way to retro-fit this to flux? Perhaps using the functor
API to walk the graph, and collect losses if that layer provides them?