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
here I have a question of the principle of Enzyme:
I mean, if there is a function:
double func(double x)
{
y = 0.5*x;
return y;
}
and I apply Enzyme on it:
__enzyme_autodiff(func, x, d_x);
obviously the d_x should be 0.5, since the return is "y", and the "d_x" should be dy/dx, which is very easy to understand
but when the form of the function is pretty complex, and there is no such a RETURN value, it becomes abstract to understand what is the "y" of the differentiation.
In addition, if there are multiple calculations involved the variable "x" like:
y = 0.5x;
z = 0.4x;
and if there is no "return y" nor "return x", in this case what is the target of the differentiation?
I know this can be tested by simple code, it's not the key question, I just wonder what is the principle of the differentiation when there is no return value in the function, is it dy/dx or dz/dx or any others?
The text was updated successfully, but these errors were encountered:
There are two ways to specify the variable being differentiated with respect to. You can return it or you can store it into data structure.
In the case of reverse mode (the default, and what calling autodiff) does: each input will be +='d by its derivative with respect to each of the outputs, times the shadow of that output.
Hello,
here I have a question of the principle of Enzyme:
I mean, if there is a function:
double func(double x)
{
y = 0.5*x;
return y;
}
and I apply Enzyme on it:
__enzyme_autodiff(func, x, d_x);
obviously the d_x should be 0.5, since the return is "y", and the "d_x" should be dy/dx, which is very easy to understand
but when the form of the function is pretty complex, and there is no such a RETURN value, it becomes abstract to understand what is the "y" of the differentiation.
In addition, if there are multiple calculations involved the variable "x" like:
y = 0.5x;
z = 0.4x;
and if there is no "return y" nor "return x", in this case what is the target of the differentiation?
I know this can be tested by simple code, it's not the key question, I just wonder what is the principle of the differentiation when there is no return value in the function, is it dy/dx or dz/dx or any others?
The text was updated successfully, but these errors were encountered: