Skip to content

Commit 2a679d8

Browse files
authored
Remove duplicate code (#528)
1 parent 25096b9 commit 2a679d8

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

src/block_coordinate_algorithms.jl

-37
Original file line numberDiff line numberDiff line change
@@ -93,34 +93,6 @@ function LazyUpdate(lazy_block::Int,refresh_rate::Int)
9393
return LazyUpdate(lazy_block, refresh_rate, 1)
9494
end
9595

96-
"""
97-
The Lazy update order is discussed in "Flexible block-iterative
98-
analysis for the Frank-Wolfe algorithm," by Braun, Pokutta, &
99-
Woodstock (2024).
100-
'lazy_block' is an index of a computationally expensive block to
101-
update;
102-
'refresh_rate' describes the frequency at which we perform
103-
a full activation; and
104-
'block_size' describes the number of "faster" blocks
105-
(i.e., those excluding 'lazy_block') activated (chosen
106-
uniformly at random) during each
107-
of the "faster" iterations; for more detail, see the
108-
article. If 'block_size' is unspecified, this defaults to
109-
1.
110-
Note: This methodology is currently only proven to work
111-
with 'FrankWolfe.Shortstep' linesearches and a (not-yet
112-
implemented) adaptive method; see the article for details.
113-
"""
114-
struct LazyUpdate <: BlockCoordinateUpdateOrder
115-
lazy_block::Int
116-
refresh_rate::Int
117-
block_size::Int
118-
end
119-
120-
function LazyUpdate(lazy_block::Int,refresh_rate::Int)
121-
return LazyUpdate(lazy_block, refresh_rate, 1)
122-
end
123-
12496
function select_update_indices(::FullUpdate, s::CallbackState, _)
12597
return [1:length(s.lmo.lmos)]
12698
end
@@ -232,15 +204,6 @@ function select_update_indices(update::LazyUpdate, s::CallbackState, dual_gaps)
232204
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))
233205
end
234206

235-
function select_update_indices(update::LazyUpdate, s::CallbackState, dual_gaps)
236-
#Returns a sequence of randomized cheap indices by
237-
#excluding update.lazy_block until "refresh_rate" updates
238-
#occur, then adds an update of everything while mainting
239-
#randomized order.
240-
l = length(s.lmo.lmos)
241-
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))
242-
end
243-
244207
"""
245208
Update step for block-coordinate Frank-Wolfe.
246209
These are implementations of different FW-algorithms to be used in a blockwise manner.

0 commit comments

Comments
 (0)