Can you explain once the diffrentiation by w in grad w is a matrix how we can differentiate with respect to a matrix

can you explain once the diffrentiation by w in grad w is a matrix how we can differentiate with respect to a matrix
and i want to ask we should take grad w also as a matrix not 0.0

Hey @hssharma2212000, if you carely see the code, you will notice that, w contains all weights and grad_w contains gradient of all weights correspondingly, if you write formula for calculating gradient of w1, than compare it with formula of that of gradients of w2, w3 and so on, You will notice that all formulas are very similar.

So we have combined that computation in form of matirx, that doesn’t mean we are taking gradients of matrix itself.

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.