@@ -30,6 +30,8 @@ function factorize(Y; kwargs...)
3030end
3131
3232"""
33+ _factorize(Y; kwargs...)
34+
3335Inner level function once keyword arguments are set
3436"""
3537function _factorize (Y; kwargs... )
@@ -56,6 +58,8 @@ function _factorize(Y; kwargs...)
5658end
5759
5860"""
61+ initialize(Y, kwargs)
62+
5963Main initialization function for `factorize`.
6064"""
6165function initialize (Y, kwargs)
@@ -79,6 +83,8 @@ function initialize(Y, kwargs)
7983end
8084
8185"""
86+ postprocess!(decomposition, Y, previous, parameters, stats_data, updateparameters!, getstats, kwargs)
87+
8288Any post algorithm processing that needs to be done in `factorize`.
8389"""
8490function postprocess! (decomposition, Y, previous, parameters, stats_data, updateparameters!, getstats, kwargs)
@@ -266,7 +272,11 @@ function finalconstrain!(decomposition; constraints, final_constraints, kwargs..
266272 return NamedTuple (kwargs) # Freeze Dict into a NamedTuple
267273end
268274
269- """ The decomposition model Y will be factored into"""
275+ """
276+ initialize_decomposition(Y; decomposition, model, rank, kwargs...)
277+
278+ The decomposition model Y will be factored into
279+ """
270280function initialize_decomposition (Y; decomposition, model, rank, kwargs... )
271281 kwargs = Dict {Symbol,Any} (kwargs)
272282 # have to add these keyword back since it was extracted by make_update # TODO check if I can safely remove these
@@ -282,6 +292,8 @@ function initialize_decomposition(Y; decomposition, model, rank, kwargs...)
282292end
283293
284294"""
295+ make_update!(decomposition, Y; momentum, constraints, constrain_init, group_updates_by_factor, do_subblock_updates, kwargs...)
296+
285297What one iteration of the algorithm looks like.
286298One iteration is likely a full cycle through each block or factor of the model.
287299"""
@@ -341,7 +353,11 @@ function make_update!(decomposition, Y; momentum, constraints, constrain_init, g
341353 return update!, kwargs
342354end
343355
344- """ The stats that will be saved every iteration"""
356+ """
357+ initialize_stats(decomposition, Y, previous, parameters; stats, kwargs...)
358+
359+ The stats that will be saved every iteration
360+ """
345361function initialize_stats (decomposition, Y, previous, parameters; stats, kwargs... )
346362 stat_functions = [S (; kwargs... ) for S in stats] # construct the AbstractStats
347363 # @show stat_functions
@@ -354,7 +370,11 @@ function initialize_stats(decomposition, Y, previous, parameters; stats, kwargs.
354370 return stats_data, getstats
355371end
356372
357- """ Keep track of one or more previous iterates"""
373+ """
374+ initialize_previous(decomposition, Y; previous_iterates::Integer, kwargs...)
375+
376+ Keep track of one or more previous iterates
377+ """
358378function initialize_previous (decomposition, Y; previous_iterates:: Integer , kwargs... )
359379 previous = [deepcopy (decomposition) for _ in 1 : previous_iterates] # TODO check if this should be copy?
360380 if previous_iterates == 0
@@ -372,7 +392,11 @@ function initialize_previous(decomposition, Y; previous_iterates::Integer, kwarg
372392 end
373393end
374394
375- """ update parameters needed for the update"""
395+ """
396+ initialize_parameters(decomposition, Y, previous; momentum::Bool, random_order, recursive_random_order, kwargs...)
397+
398+ update parameters needed for the update
399+ """
376400function initialize_parameters (decomposition, Y, previous; momentum:: Bool , random_order, recursive_random_order, kwargs... )
377401 # parameters for the update step are symbol => value pairs
378402 # they are held in a dictionary since we may mutate these for ex. the stepsize
0 commit comments