Group Abstract Group Abstract

Message Boards Message Boards

Add a customized complex loss function to a neural network?

Posted 7 years ago
POSTED BY: Guy Malki
3 Replies
Posted 7 years ago
POSTED BY: Guy Malki
Posted 7 years ago

Thank you very much, Martijn. Can I define for each loss layer different "Target" and "Input" ports ? Where to do it ?

POSTED BY: Guy Malki

You can add as many loss layers layers as you want and by specifying the LossFunction in NetTrain you can say which Outputs of your network are the loss layers to use. For building a loss function you can just used the default net building blocks as you can see in the example below.

In this case NetTrain[ , LossFunction->{"Loss1","Loss2","Loss3"}]. As far as i understand anything will work as long as the output of your loss net is a Real value.

custom loss layers

POSTED BY: Martijn Froeling
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard