Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

shape dictionary #4

Open
HUSTxyy opened this issue Nov 21, 2022 · 1 comment
Open

shape dictionary #4

HUSTxyy opened this issue Nov 21, 2022 · 1 comment

Comments

@HUSTxyy
Copy link

HUSTxyy commented Nov 21, 2022

Hi! Sorry to bother you. Does the code of Shape Dictionary include in the git? I mean the generation of shape dictionary,I don't find it in your code. If you could offer the part of code,I would appreciate it!

@ElectronicElephant
Copy link
Collaborator

Hi,

To generate the dictionary, you can follow the following code snippet.

Note that images should be of shape (N, M), where $N$ is the number of samples, and $M$ is the resolution of each mask, e.g., $64*64=4096$

from sklearn.decomposition import DictionaryLearning

dico = DictionaryLearning(n_components=n_components, n_jobs=-1, max_iter=n_iter, verbose=True)
dico.fit(images)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants