-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Closed
Labels
Description
Description
-
There is code / logic duplication between
decomposition.dict_learning.py.dict_learninganddict_learning_online. Formally, the code should be equivalent except, that- for the former the codes should be computed all at once (
batch_size = n_samples) and this process iterated (alternating BCD, as it's already done), whilst - for the latter the each sample point's code is computed as the sample is pooled-in. The dictionary update function should the same in both case (Alg2 of the ref paper.)
- for the former the codes should be computed all at once (
-
As a side effect of this code duplication, there prototype of backend
_update_dictfunction is somewhat "dangling". E.g the shape of argumentcodecan be(n_components, n_features)or(n_components, n_features)depending on whether it's called from withindict_learningordict_learning_onlineresp.
Proposal
Have a single function dict_learning_online(batch_size=some_default) which reproduces full-batch mode (the current dict_learning function) when batch_size == n_samples.