When using the backend = AutoFiniteDiff(absstep=100, relstep=0.01) one would expect the state to be perturbed with a value of max(100.0, 0.01*x), but this doesn't actually happen. It looks like relstep is set to be equal to absstep somewhere.
julia> backend = AutoFiniteDiff(absstep=100, relstep=0.01)
AutoFiniteDiff(relstep=0.01, absstep=100, )
julia> x = collect(1.0:5.0)
5-element Vector{Float64}:
1.0
2.0
3.0
4.0
5.0
julia> function f(x)
println(x)
sum(abs2, x)
end
f (generic function with 1 method)
julia> gradient(f, backend, x)
[1.0, 2.0, 3.0, 4.0, 5.0]
[1.0, 2.0, 3.0, 4.0, 5.0]
[1.01, 2.0, 3.0, 4.0, 5.0]
[1.0, 2.0, 3.0, 4.0, 5.0]
[1.0, 2.02, 3.0, 4.0, 5.0]
[1.0, 2.0, 3.0, 4.0, 5.0]
[1.0, 2.0, 3.03, 4.0, 5.0]
[1.0, 2.0, 3.0, 4.0, 5.0]
[1.0, 2.0, 3.0, 4.04, 5.0]
[1.0, 2.0, 3.0, 4.0, 5.0]
[1.0, 2.0, 3.0, 4.0, 5.05]
5-element Vector{Float64}:
2.009999999999934
4.019999999999868
6.030000000000039
8.040000000000092
10.049999999999955
When using the
backend = AutoFiniteDiff(absstep=100, relstep=0.01)one would expect the state to be perturbed with a value ofmax(100.0, 0.01*x), but this doesn't actually happen. It looks likerelstepis set to be equal toabsstepsomewhere.