How does "Module" know the loss function?


#1

I just read the module tutorial in https://mxnet.incubator.apache.org/tutorials/basic/module.html. But I cannot find where to set the loss function using the " Intermediate-level Interface" APIs.


#2

In symbolic mode, it’s somewhat confusing in the first time, but the last SoftmaxOutput symbol adds the softmax cross entropy loss to the module (common case for classification). Here discusses how to make custom loss with mx.symbol.MakeLoss.

Generally, if you can try to use gluon API (related doc) as much as possible to have more flexibility and nicer debugging options.