custom loss function for DNN training

59 ビュー (過去 30 日間)
Pratheek
Pratheek 2019 年 5 月 16 日
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 日
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

サインインしてコメントする。


Dinial Utami Nurul Qomariah
Dinial Utami Nurul Qomariah 2020 年 1 月 27 日

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by