{"action":"reopened","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4746","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4746/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4746/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4746/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/4746","id":78495139,"number":4746,"title":"Dictionary learning is slower and fail with n_jobs > 1","user":{"login":"arthurmensch","id":4078691,"avatar_url":"https://avatars.githubusercontent.com/u/4078691?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurmensch","html_url":"https://github.com/arthurmensch","followers_url":"https://api.github.com/users/arthurmensch/followers","following_url":"https://api.github.com/users/arthurmensch/following{/other_user}","gists_url":"https://api.github.com/users/arthurmensch/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurmensch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurmensch/subscriptions","organizations_url":"https://api.github.com/users/arthurmensch/orgs","repos_url":"https://api.github.com/users/arthurmensch/repos","events_url":"https://api.github.com/users/arthurmensch/events{/privacy}","received_events_url":"https://api.github.com/users/arthurmensch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Bug","name":"Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-20T11:56:49Z","updated_at":"2015-05-22T11:56:28Z","closed_at":null,"body":"dict_learning_online fails with n_jobs > 1. Bug can be reproduced using denoising examples available in the doc : \r\n\r\nhttps://gist.github.com/arthurmensch/d85f9efb3716fe090937\r\n\r\nObserved images are not correct, and dictionary learning take much longer time.\r\n\r\nIncriminated code can be located in function sparse_encode in sklearn.decomposition.dict_learning, line 248.\r\n\r\n```python\r\n    code_views = Parallel(n_jobs=n_jobs)(\r\n        delayed(_sparse_encode)(\r\n            X[this_slice], dictionary, gram, cov[:, this_slice], algorithm,\r\n            regularization=regularization, copy_cov=copy_cov,\r\n            init=init[this_slice] if init is not None else None,\r\n            max_iter=max_iter)\r\n        for this_slice in slices)\r\n```"}}