Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Feb 5, 2024
2 parents ac5e705 + 0d4aa9a commit 97baa3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
file: ./lcov.info
name: codecov-umbrella
Expand Down
7 changes: 4 additions & 3 deletions src/ImprovedHagerZhangLinesearch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using Manopt: max_stepsize, get_cost_function
# on the parameters

mutable struct HagerZhangLinesearch{
T,TRM<:AbstractRetractionMethod,VTM<:AbstractVectorTransportMethod,P,TX
T<:Real,TRM<:AbstractRetractionMethod,VTM<:AbstractVectorTransportMethod,P,TX
} <: Linesearch
delta::T # c_1 Wolfe sufficient decrease condition
sigma::T # c_2 Wolfe curvature condition (Recommend 0.1 for GradientDescent)
Expand Down Expand Up @@ -51,11 +51,11 @@ function HagerZhangLinesearch(
gamma::T=0.66,
linesearchmax::Int=50,
psi3::T=0.1,
) where {P,TRM<:AbstractRetractionMethod,VTM<:AbstractVectorTransportMethod,T,TX}
) where {P,TRM<:AbstractRetractionMethod,VTM<:AbstractVectorTransportMethod,T<:Real,TX}
return HagerZhangLinesearch{T,TRM,VTM,P,TX}(
delta,
sigma,
alphamax,
convert(T, alphamax),
rho,
epsilon,
gamma,
Expand Down Expand Up @@ -124,6 +124,7 @@ function (ls::HagerZhangLinesearch)(ϕdϕ, c::T, phi_0::Real, dphi_0::Real) wher
throw(ErrorException("Value and slope at step length = 0 must be finite."))
end
if dphi_0 >= eps(T) * abs(phi_0)
println("Values: $dphi_0, $(abs(phi_0))")
throw(ErrorException("Search direction is not a direction of descent."))
elseif dphi_0 >= 0
return zeroT, phi_0
Expand Down

0 comments on commit 97baa3c

Please sign in to comment.