returnn icon indicating copy to clipboard operation
returnn copied to clipboard

Refactor losses into layers

Open albertz opened this issue 4 years ago • 1 comments

Multiple things:

  • Loss becomes a subclass of LayerBase
  • Loss instances will be treated as normal layers, and the name logic for moving them out of rec loop etc will apply.

This should greatly cleanup the complexity we currently have with LayerBase.get_losses and LossHolder.

This should also fix some bugs along the way, e.g. #556.

albertz avatar Aug 31 '21 14:08 albertz

Note that with RETURNN-common, this is not so much an issue anymore, as RETURNN common only uses the AsIsLoss, and all losses are already defined via normal layers.

albertz avatar Oct 14 '22 20:10 albertz