4

大規模なデータセットがあり、画像からガボール フィルターを取得しようとしています。データセットが大きくなりすぎると、メモリ エラーが発生します。これまでのところ、私はこのコードを持っています:

import numpy
from sklearn.feature_extraction.image import extract_patches_2d
from sklearn.decomposition import MiniBatchDictionaryLearning
from sklearn.decomposition import FastICA

def extract_dictionary(image, patches_size=(16,16), projection_dimensios=25, previous_dictionary=None):
    """
    Gets a higher dimension ica projection image.

    """
    patches = extract_patches_2d(image, patches_size)
    patches = numpy.reshape(patches, (patches.shape[0],-1))[:LIMIT]
    patches -= patches.mean(axis=0)
    patches /= numpy.std(patches, axis=0)
    #dico = MiniBatchDictionaryLearning(n_atoms=projection_dimensios, alpha=1, n_iter=500)
    #fit = dico.fit(patches)
    ica = FastICA(n_components=projection_dimensios)
    ica.fit(patches)

    return ica

LIMIT が大きい場合、メモリ エラーがあります。scikit または他の python パッケージに ICA のオンライン (インクリメンタル) 代替手段はありますか?

4

1 に答える 1

4

いいえ、ありません。本当にICAフィルターが必要ですか?試しましたがMiniBatchDictionaryLearningMiniBatchKMeans代わりにオンラインですか?

Also, although not strictly online RandomizedPCA is able to address medium to largish data if the number of components to extract is small.

于 2013-01-02T00:01:59.580 に答える