Question about creating a custom regression layer in matlab NN toolbox

The information required to create a custom regression layer is given in the link https://www.mathworks.com/help/deeplearning/ug/define-custom-regression-output-layer.html. I have a question about the information given in this link, specifically in step 5 : create a backward loss function. The sample code given is
function dLdY = backwardLoss(layer, Y, T)
% Returns the derivatives of the MAE loss with respect to the predictions Y
R = size(Y,3);
N = size(Y,4);
dLdY = sign(Y-T)/(N*R);
end
Shoudn't there be a summation over the mini-batch size when computing dLdY? Or does the toolbox take care of it internally?

Réponses (0)

Catégories

En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by