Skip to content

Commit

Permalink
Remove duplicate code (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisHal authored Nov 12, 2024
1 parent 25096b9 commit 2a679d8
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions src/block_coordinate_algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,34 +93,6 @@ function LazyUpdate(lazy_block::Int,refresh_rate::Int)
return LazyUpdate(lazy_block, refresh_rate, 1)
end

"""
The Lazy update order is discussed in "Flexible block-iterative
analysis for the Frank-Wolfe algorithm," by Braun, Pokutta, &
Woodstock (2024).
'lazy_block' is an index of a computationally expensive block to
update;
'refresh_rate' describes the frequency at which we perform
a full activation; and
'block_size' describes the number of "faster" blocks
(i.e., those excluding 'lazy_block') activated (chosen
uniformly at random) during each
of the "faster" iterations; for more detail, see the
article. If 'block_size' is unspecified, this defaults to
1.
Note: This methodology is currently only proven to work
with 'FrankWolfe.Shortstep' linesearches and a (not-yet
implemented) adaptive method; see the article for details.
"""
struct LazyUpdate <: BlockCoordinateUpdateOrder
lazy_block::Int
refresh_rate::Int
block_size::Int
end

function LazyUpdate(lazy_block::Int,refresh_rate::Int)
return LazyUpdate(lazy_block, refresh_rate, 1)
end

function select_update_indices(::FullUpdate, s::CallbackState, _)
return [1:length(s.lmo.lmos)]
end
Expand Down Expand Up @@ -232,15 +204,6 @@ function select_update_indices(update::LazyUpdate, s::CallbackState, dual_gaps)
return push!([[rand(range(1,l)[1:l .!= update.lazy_block]) for _ in range(1,update.block_size)] for _ in 1:(update.refresh_rate -1)], range(1,l))
end

function select_update_indices(update::LazyUpdate, s::CallbackState, dual_gaps)
#Returns a sequence of randomized cheap indices by
#excluding update.lazy_block until "refresh_rate" updates
#occur, then adds an update of everything while mainting
#randomized order.
l = length(s.lmo.lmos)
return push!([[rand(range(1,l)[1:l .!= update.lazy_block]) for _ in range(1,update.block_size)] for _ in 1:(update.refresh_rate -1)], range(1,l))
end

"""
Update step for block-coordinate Frank-Wolfe.
These are implementations of different FW-algorithms to be used in a blockwise manner.
Expand Down

0 comments on commit 2a679d8

Please sign in to comment.