@@ -9,29 +9,29 @@ see the paper [1].
99
1010### Keyword Arguments
1111
12- - `σ_min`: the minimum value of the spectral coefficient `σ_k` which is related to the step
13- size in the algorithm. Defaults to `1e-10`.
14- - `σ_max`: the maximum value of the spectral coefficient `σ_k` which is related to the step
15- size in the algorithm. Defaults to `1e10`.
12+ - `σ_min`: the minimum value of the spectral coefficient `σ_k` which is related to the
13+ step size in the algorithm. Defaults to `1e-10`.
14+ - `σ_max`: the maximum value of the spectral coefficient `σ_k` which is related to the
15+ step size in the algorithm. Defaults to `1e10`.
1616 - `σ_1`: the initial value of the spectral coefficient `σ_k` which is related to the step
1717 size in the algorithm.. Defaults to `1.0`.
1818 - `M`: The monotonicity of the algorithm is determined by a this positive integer.
1919 A value of 1 for `M` would result in strict monotonicity in the decrease of the L2-norm
20- of the function `f`. However, higher values allow for more flexibility in this reduction.
21- Despite this, the algorithm still ensures global convergence through the use of a
22- non-monotone line-search algorithm that adheres to the Grippo-Lampariello-Lucidi
20+ of the function `f`. However, higher values allow for more flexibility in this
21+ reduction. Despite this, the algorithm still ensures global convergence through the use
22+ of a non-monotone line-search algorithm that adheres to the Grippo-Lampariello-Lucidi
2323 condition. Values in the range of 5 to 20 are usually sufficient, but some cases may call
2424 for a higher value of `M`. The default setting is 10.
25- - `γ`: a parameter that influences if a proposed step will be accepted. Higher value of `γ`
26- will make the algorithm more restrictive in accepting steps. Defaults to `1e-4`.
25+ - `γ`: a parameter that influences if a proposed step will be accepted. Higher value of
26+ `γ` will make the algorithm more restrictive in accepting steps. Defaults to `1e-4`.
2727 - `τ_min`: if a step is rejected the new step size will get multiplied by factor, and this
2828 parameter is the minimum value of that factor. Defaults to `0.1`.
2929 - `τ_max`: if a step is rejected the new step size will get multiplied by factor, and this
3030 parameter is the maximum value of that factor. Defaults to `0.5`.
3131 - `nexp`: the exponent of the loss, i.e. ``f_k=||F(x_k)||^{nexp}``. The paper uses
3232 `nexp ∈ {1,2}`. Defaults to `2`.
3333 - `η_strategy`: function to determine the parameter `η_k`, which enables growth
34- of ``||F||^2``. Called as `` η_k = η_strategy(f_1, k, x, F)` ` with `f_1` initialized as
34+ of ``||F||^2``. Called as `η_k = η_strategy(f_1, k, x, F)` with `f_1` initialized as
3535 ``f_1=||F(x_1)||^{nexp}``, `k` is the iteration number, `x` is the current `x`-value and
3636 `F` the current residual. Should satisfy ``η_k > 0`` and ``∑ₖ ηₖ < ∞``. Defaults to
3737 ``||F||^2 / k^2``.
@@ -83,7 +83,8 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SimpleDFSane{M}, args...
8383 α_1 = one (T)
8484 f_1 = fx_norm
8585
86- history_f_k = if x isa SArray
86+ history_f_k = if x isa SArray ||
87+ (x isa Number && __is_extension_loaded (Val (:StaticArrays )))
8788 ones (SVector{M, T}) * fx_norm
8889 else
8990 fill (fx_norm, M)
0 commit comments