Backward Propagation and Hinge Loss
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi
I plan to write a function which will output the derivative of a hinge loss w.r.t the ground truth. I consider the function as following from this link:
+
where as Y(the first parameter)is the prediction and Y.(the second parameter) is the ground truth.
During calcualting bakward loss, what I understand is, I need to calcualte the derivative of the above loss w.r.t the second paramter, right? In that case, will the code be like following:
function dLdX = backwardLoss1( this, Y, T )
% backwardLoss Back propagate the derivative of the loss
% function
%
% Syntax:
% dLdX = layer.backwardLoss( Y, T );
%
% Image Inputs:
% Y Predictions made by network, 1-by-1-by-numClasses-by-numObs
% T Targets (actual values), 1-by-1-by-numClasses-by-numObs
%
% Vector Inputs:
% Y Predictions made by network, numClasses-by-numObs-by-seqLength
% T Targets (actual values), numClasses-by-numObs-by-seqLength
if(Y*T<1)
dLdX=-T/size(Y);
else
dLdX=0;
end
end
But following this link, it's diplaying the calculation of the derivative w.r.t the parameters which makes me confuse that shuld I need to output the los w.rt the weights as well as w.r.t to the ground truth?
I am looking for your suggestions in this reagrd.
thanks,
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!