How can I use Zygote to get the gradient

Hello,

I am new here and i just add the pkg Zygote to find the gradient of the function (2+2*alpha-3)^2, i want to get the value of alpha how can i do that

What do you mean by “getting the value of alpha”?

In automatic differentiation, when differentiating a function you get a function that you can evaluate on a specific value. For example:

julia> using Zygote
julia> f(α) = (2 + 2α - 3)^2
julia> f'(1)
4 # equivalent to 2 * (2 + 2 * 1 - 3) * 2 = 4

I suppose the only way to make sense of it is you want the df/d\alpha at a particular value of alpha.

@Yoobi In general if you make a MWE, it will make it easier to help you PSA: make it easier to help you

for example f(x1)=(0+(2+2α-3)^2+4(-1-1024α+5)^4) i want to know how to find the value of the f(x1) where the alpha value is unknown

yes i want to know how to use the df/d\alpha

i am not comprehending this.

okay thanks