# Warning overflow encounter with infomax

**URL:** https://mne.discourse.group/t/warning-overflow-encounter-with-infomax/4904
**Category:** Support & Discussions
**Tags:** eeg, ica
**Created:** [May 18, 2022, 11:11am UTC](https://mne.discourse.group/t/warning-overflow-encounter-with-infomax/4904 "2022-05-18T11:11:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fooms2512](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/fooms2512/32/897_2.png) [@fooms2512](https://mne.discourse.group/u/fooms2512)
#### Post date: [May 18, 2022, 11:11am UTC](https://mne.discourse.group/t/warning-overflow-encounter-with-infomax/4904/1 "2022-05-18T11:11:41Z")

</div>

Hi,  
I’m performing an ICA (infomax) on resting-state eeg data (epoch length=2 seconds)  
The process is running, but I have the following warning message:

C:\Users\win\anaconda3\lib\site-packages\mne\preprocessing\infomax\_.py:192: RuntimeWarning: overflow encountered in exp  
y = 1.0 / (1.0 + np.exp(-u))

I run my script on jupyter notebook on Windows 11 Insider Preview 22621.1  
What should I do to avoid this warning message. May I still rely on the ica results?

Thanks for your help

Fred

**❓ If you have a question or issue with MNE-Python, please include the following info:**

- MNE version: e.g. 0.24.0
- operating system: e.g. macOS 12 / Windows 10 / Ubuntu 18.04

**📄 Please also provide relevant code snippets – ideally a [minimal working example](https://stackoverflow.com/help/minimal-reproducible-example) (MWE).**

🖋 To get the correct formatting, paste your Python code, then select it, and click on the **Preformatted text** toolbar button.

**📵 Please avoid sharing screenshots of code and error messages!** Screenshots are difficult to work with especially on mobile devices; they don’t allow others to copy code and other text; and they don’t show up in the search.

👉 👉 👉 Please edit or remove the above text before submitting your posting. 👈 👈 👈

---

<div class="post-metadata">

### Author: ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)
#### Post date: [May 18, 2022, 1:34pm UTC](https://mne.discourse.group/t/warning-overflow-encounter-with-infomax/4904/2 "2022-05-18T13:34:15Z")

</div>

I think you can certainly ignore this warning but I would say we need to use this function:

[https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.expit.html#scipy-special-expit](https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.expit.html#scipy-special-expit)

which should be more numerically stable.

could you submit a pull request to make the change?

Alex

---

<div class="post-metadata">

### Author: ![fooms2512](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/fooms2512/32/897_2.png) [@fooms2512](https://mne.discourse.group/u/fooms2512)
#### Post date: [May 18, 2022, 1:36pm UTC](https://mne.discourse.group/t/warning-overflow-encounter-with-infomax/4904/3 "2022-05-18T13:36:11Z")

</div>

Hi Alex,  
Thank you for your answer. This is the second time I’m using the forum… Is there a way to submit a pull request?

---

<div class="post-metadata">

### Author: ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)
#### Post date: [May 18, 2022, 5:19pm UTC](https://mne.discourse.group/t/warning-overflow-encounter-with-infomax/4904/4 "2022-05-18T17:19:03Z")

</div>

I’ve opened an issue on GitHub:

> <https://github.com/mne-tools/mne-python/issues/10650>
>
> To avoid an overflow when manually calculating \`y = 1.0 / (1.0 + np.exp(-u))\`
> 
> …
> Suggested by @agramfort in https://mne.discourse.group/t/warning-overflow-encounter-with-infomax/4904/2
