why gradient and diff return many values?
显示 更早的评论
hello,
I need use the derivatives for example in loss function is J(w,b) such that find
w=w-α * (∂J/ ∂w)
when I used diff or gradient I have many values, In fact I need only one value represent (∂J/ ∂w).
Please, can one help me to provide me with that command.
Thanks in advance
4 个评论
Jan
2021-3-7
The readers cannot guess, what your inputs are.
KALYAN ACHARJYA
2021-3-7
More, the result after gradient operator is always vector.
dpb
2021-3-7
How well it would work or even be reasonable would be entirely dependent upon the problem characteristics but one could try mean(gradient()) to get an average to reduce a vector to one value.
huda nawaf
2021-3-7
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!