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.
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.
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 beg as f64 * f * (x_val - t).powi(g-1)
but isg as f64 * f * (x_val - t)
in your code.