Skip to content

Commit

Permalink
Use the best value for phi.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrych committed Sep 4, 2024
1 parent 8097a37 commit 8688e8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/blended_pairwise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ function blended_pairwise_conditional_gradient(
grad!(gradient, x)
v = compute_extreme_point(lmo, gradient)
primal = f(x)
phi = fast_dot(x, gradient) - fast_dot(v, gradient)
phi_new = fast_dot(x, gradient) - fast_dot(v, gradient)
phi = phi_new < phi ? phi_new : phi
tt = last
tot_time = (time_ns() - time_start) / 1e9
if callback !== nothing
Expand Down Expand Up @@ -458,6 +459,7 @@ function blended_pairwise_conditional_gradient(
v = compute_extreme_point(lmo, gradient)
primal = f(x)
dual_gap = fast_dot(x, gradient) - fast_dot(v, gradient)
dual_gap = dual_gap < phi ? dual_gap : phi
end
tt = pp
tot_time = (time_ns() - time_start) / 1e9
Expand All @@ -466,7 +468,7 @@ function blended_pairwise_conditional_gradient(
t,
primal,
primal - dual_gap,
phi,
dual_gap,
tot_time,
x,
v,
Expand Down

0 comments on commit 8688e8a

Please sign in to comment.