You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a complicated loss function for my problem so the derivatives are a bit convoluted and annoying to work with hence I am considering to use autodiff. However, this loss function requires real world samples at any time t, but these parameters are not the target of optimization. I was aiming to use backward mode so I can get all the partial derivatives in one go. I have looked at the documentation and was wondering if something like this was possible,
// Samples derived in real-time go inside somehow
struct Params {// Insert dynamic data structure here, like a vector or something};
// The function that depends on parameters for which derivatives are needed
var f(var a, var b, var c, var d, var e, const Params& params)
{
// Insert complicated loss here, e.g.,
for (const auto& param: params) {
Params new_params = params - offset_tensor;
alpha = new_params / a - b*...
}
return loss_val;
}
Also just as a side question, are there any suggestions for new users like me to make sure that the autodiff routine runs as fast as possible?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Good day,
I have a complicated loss function for my problem so the derivatives are a bit convoluted and annoying to work with hence I am considering to use autodiff. However, this loss function requires real world samples at any time t, but these parameters are not the target of optimization. I was aiming to use backward mode so I can get all the partial derivatives in one go. I have looked at the documentation and was wondering if something like this was possible,
Also just as a side question, are there any suggestions for new users like me to make sure that the autodiff routine runs as fast as possible?
Thank you very much in advance
Beta Was this translation helpful? Give feedback.
All reactions