custom loss function for DNN training

how can i write a custom loss fucntion for DNN training. I want to try reconstruction loss

답변 (2개)

Shounak Mitra
Shounak Mitra 2019년 5월 17일

1 개 추천

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

ghali ahmed
ghali ahmed 2019년 10월 17일
hi!
is there more details for a real implementation :)
thank's

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Install Products에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2019년 5월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by