uwgraphics / relaxed_ik_core

MIT License
84 stars 26 forks source link

Groove loss derivative #7

Closed wuyingnan closed 1 year ago

wuyingnan commented 1 year ago

Hello,

I found that groove loss derivative calculation maybe incorrect in your code.

The groove function is written as -( (-(x_val - t).powi(d)) / (2.0 * c.powi(2) ) ).exp() + f * (x_val - t).powi(g). The second term of the derivate should be g as f64 * f * (x_val - t).powi(g-1) but is g as f64 * f * (x_val - t) in your code.

yepw commented 1 year ago

Thanks for pointing it out. I have fixed it. Actually, that function is mainly for debugging purposes and is not used. Gradients are actually calculated using finite difference.