Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between DictionaryLearning and MiniBatchDictionaryLearning in scikit-learn

I am trying to write some code for Dictionary Learning by using scikit-learn lib in Python. But I found two function, Both function looks like same.

I want to know what is the difference between them ?

like image 929
Sudip Das Avatar asked Mar 23 '26 20:03

Sudip Das


1 Answers

DictionaryLearning is a full-batch method, where the whole data is kept in memory during learning.

MiniBatchDictionaryLearning is a minibatch method (only n=minibatch-size items need to be in memory within each iteration), where partial_fit (= fit on minibatch) is supported to work on bigger instances without hitting memory too hard.

While the general idea is the same, these algorithms are different and target different use-cases.

If you can use the former with your memory, use it. If not, use the latter.

If using the minibatch-variant, keep in mind, that there is still an open bug in regards to partial_fit.

A general overview about large-scale computing and escpecially incremental-learning within sklearn (where MiniBatchDictionaryLearning is mentioned) can be found here. It also mentions the downside: tuning the hyperparameter minibatch-size.

like image 179
sascha Avatar answered Mar 26 '26 10:03

sascha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!