custom loss function for DNN training

60 visualizaciones (últimos 30 días)
Pratheek
Pratheek el 16 de Mayo de 2019
how can i write a custom loss fucntion for DNN training. I want to try reconstruction loss

Respuestas (2)

Shounak Mitra
Shounak Mitra el 17 de Mayo de 2019
You can create custom layers and define custom loss functions for output layers.
The output layer uses two functions to compute the loss and the derivatives: forwardLoss and backwardLoss. The forwardLoss function computes the loss L. The backwardLoss function computes the derivatives of the loss with respect to the predictions.
For eg., to write a weighted cross entropy classification loss, try running this in the MATLAB command window
>> edit(fullfile(matlabroot,'examples','deeplearning_shared','main','weightedClassificationLayer.m'))
Hope this helps
  1 comentario
ghali ahmed
ghali ahmed el 17 de Oct. de 2019
hi!
is there more details for a real implementation :)
thank's

Iniciar sesión para comentar.


Dinial Utami Nurul Qomariah
Dinial Utami Nurul Qomariah el 27 de En. de 2020

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by