Skip to content

Commit

Permalink
Norm has been fixed upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Dec 6, 2023
1 parent 0c42dbc commit f4f12d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/broyden.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function perform_step!(cache::GeneralBroydenCache{iip, IJ, UR}) where {iip, IJ,
ifelse(iszero(denom), T(1e-5), denom)
@bb cache.J⁻¹ += vec(cache.du) × transpose(_vec(cache.u_cache))
elseif UR === :bad_broyden
dfu_norm = norm(cache.dfu)^2
dfu_norm = cache.internalnorm(cache.dfu)^2
@bb @. cache.du = (cache.du - cache.J⁻¹dfu) /
ifelse(iszero(dfu_norm), T(1e-5), dfu_norm)
@bb cache.J⁻¹ += vec(cache.du) × transpose(_vec(cache.dfu))
Expand Down
1 change: 0 additions & 1 deletion src/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ function __reinit_internal!(cache::TrustRegionCache; kwargs...)
return nothing
end

# This only holds for 2-norm?
__trust_region_loss(cache::TrustRegionCache, x) = __trust_region_loss(cache.internalnorm, x)
__trust_region_loss(nf::F, x) where {F} = nf(x)^2 / 2

Expand Down

0 comments on commit f4f12d3

Please sign in to comment.