As far as I know, there are 3 loss layers available to use in NetTrain function. But is there anyway to use custom and more complex loss functions? As a simple example, I just tried to define a custom (but the same) MeanAbsoluteLossLayer exactly like what it was in it's documentations:
meanAbsLoss = Mean@Flatten[Abs[#Input - #Target], Infinity] &;
But when I use this loss function in NetTrain, I get this failure error:
"Loss specification should be a loss layer, Automatic, or an output \port or list of ports."
Function::slot1: (Mean[Flatten[Abs[#Input-#Target],\[Infinity]]]&)[] is expected to have an Association as the first argument.
Can you please help me with this problem?