# Learning dictionary for events

**URL:** <https://mne.discourse.group/t/learning-dictionary-for-events/3775>\
**Category:** Support & Discussions\
**Tags:** machine-learning\
**Created:** [October 5, 2021, 2:18pm UTC](https://mne.discourse.group/t/learning-dictionary-for-events/3775 "2021-10-05T14:18:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehdikuchi](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mehdikuchi/32/188_2.png) [@mehdikuchi](https://mne.discourse.group/u/mehdikuchi)\
**Post date:** [October 5, 2021, 2:18pm UTC](https://mne.discourse.group/t/learning-dictionary-for-events/3775/1 "2021-10-05T14:18:08Z")

</div>

Dear developers,  
I am implementing the code for the following paper:  
Jas, M., La Tour, T. D., Şimşekli, U., & Gramfort, A. (2017). Learning the morphology of brain signals using alpha-stable convolutional sparse coding. arXiv preprint arXiv:1705.08006.

Unfortunately, I am currently stuck in the optimization step for the activations.  
Here is the Github link to the codes I have developed so far:

> **[GitHub - mehdikuchi/alphaCSC](https://github.com/mehdikuchi/alphaCSC)**
>
> Contribute to mehdikuchi/alphaCSC development by creating an account on GitHub.

The problem is that for optimization I am getting ABNORMAL\_TERMINATION\_IN\_LNSRCH.  
I would appreciate it if someone could help me in finding the potential errors and get the optimization done.

Thanks

---

<div class="post-metadata">

**Author:** ![mainakjas](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mainakjas/32/34_2.png) [@mainakjas](https://mne.discourse.group/u/mainakjas)\
**Post date:** [October 5, 2021, 3:39pm UTC](https://mne.discourse.group/t/learning-dictionary-for-events/3775/2 "2021-10-05T15:39:09Z")

</div>

Hi Mahdi,

Why are you trying to reimplement this? We provide all the code here:

[https://alphacsc.github.io/](https://alphacsc.github.io/)

with fully documented source code and examples. Perhaps you have not seen this.

Also, quick googling seems to suggest that the error you are getting is because your gradient doesn’t match the cost function. You might want to use scipy functions `check_grad` to ensure you are computing the right thing.

Mainak

---

<div class="post-metadata">

**Author:** ![mehdikuchi](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mehdikuchi/32/188_2.png) [@mehdikuchi](https://mne.discourse.group/u/mehdikuchi)\
**Post date:** [October 5, 2021, 3:43pm UTC](https://mne.discourse.group/t/learning-dictionary-for-events/3775/3 "2021-10-05T15:43:09Z")

</div>

Thanks a lot I had searched for it with no sucess.  
Thanks.
