Effacer les filtres
Effacer les filtres

Recreating MATLAB RegressionLayer as custom RegressionLayer?

2 vues (au cours des 30 derniers jours)
Jake
Jake le 9 Oct 2018
MATLAB Documentation (https://www.mathworks.com/help/deeplearning/ref/regressionlayer.html) says the regression layer using the half-mean-squared-error as the loss function in the regression layer. I'd like to replicate this layer myself, similar to the MAE loss function tutorial (https://www.mathworks.com/help/deeplearning/ug/define-custom-regression-output-layer.html), so that I can ultimately start tweaking it. For now though, I just want to replicate it exactly.
I think the correct (GPU implemented) loss function in the fowardLoss layer would be as follows:
R = size(Y,3); MSE = sum((Y-T).*(Y-T),3)/(R*2); N = size(Y,4); loss = sum(MSE)/N;
However, I'm not sure about the backwardLoss implementation. My best guess would be:
R = size(Y,3); N = size(Y,4); dLdY = (Y-T)/(N*R);
Is this correct?

Réponses (0)

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by