Repository: pierreablin/picard

Issue:
[Bug][version : 0.7] Running picard with infomax and an exponential density model leads to a FloatingPointError
Hello,

First of all, thank you for this great package. It helps me a lot in my project. 

Running picard on simple data sets I encountered a FloatingPointError with infomax and the exponential density model.

Thank you for your help,

Nicolas Captier

**package version : 0.7**

## Description of the bug

When running `picard` function with `ortho = False` , `extended = False` and `fun = 'exp'` a FloatingPointError appears.  I tested different data sets and I systematically encountered this error.

## Minimal code to reproduce the bug

```
import numpy as np
from picard import picard
N, T = 3, 1000
S = np.random.laplace(size=(N, T))
A = np.random.randn(N, N)
X = np.dot(A, S)
K, W, Y = picard(X , ortho = False , extended = False , fun = 'exp')
```

## Screen shots of the error messages

![image](https://user-images.githubusercontent.com/60263988/145220109-e8a239ed-692c-4291-8437-b6607e1188a8.png)
![image](https://user-images.githubusercontent.com/60263988/145220314-830e8d12-c2ad-4058-900e-98f9baba106d.png)


Comments:

Patch:
diff --git a/README.rst b/README.rst
index 49fb927..d82d5b3 100644
--- a/README.rst
+++ b/README.rst
@@ -159,3 +159,9 @@ If you use this code in your project, please cite::
     Faster ICA under orthogonal constraint
     ICASSP, 2018
     https://arxiv.org/abs/1711.10873
+
+
+Changelog
+---------
+
+New in 0.8 : for the density `exp`, the default parameter is now alpha = 0.1 instead of alpha = 1.
\ No newline at end of file
diff --git a/doc/doc-requirements.txt b/doc/doc-requirements.txt
index 540bae1..69e9182 100644
--- a/doc/doc-requirements.txt
+++ b/doc/doc-requirements.txt
@@ -3,4 +3,6 @@ numpydoc
 pillow
 scikit-learn >=0.18
 sphinx-bootstrap-theme
-sphinx-gallery
\ No newline at end of file
+sphinx-gallery
+pooch
+tqdm
\ No newline at end of file
diff --git a/picard/solver.py b/picard/solver.py
index fc4bee9..5cdb06a 100644
--- a/picard/solver.py
+++ b/picard/solver.py
@@ -148,7 +148,7 @@ def picard(X, fun='tanh', n_components=None, ortho=True, extended=None,
     if fun == 'tanh':
         fun = Tanh()
     elif fun == 'exp':
-        fun = Exp()
+        fun = Exp(params={'alpha': 0.1})
     elif fun == 'cube':
         fun = Cube()
     elif check_fun:


Test patch:
diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml
index 34bbc6e..fff8351 100644
--- a/.github/workflows/unittests.yml
+++ b/.github/workflows/unittests.yml
@@ -13,7 +13,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python: [3.7, 3.8, 3.9]
+        python: [3.8, 3.9]
     steps:
       - uses: actions/checkout@v2
       - uses: conda-incubator/setup-miniconda@v2
diff --git a/picard/tests/test_solver.py b/picard/tests/test_solver.py
index 1a63ba6..885e538 100644
--- a/picard/tests/test_solver.py
+++ b/picard/tests/test_solver.py
@@ -187,7 +187,7 @@ def test_picardo():
             if fun == 'tanh':
                 fun = Tanh()
             elif fun == 'exp':
-                fun = Exp()
+                fun = Exp(params={'alpha': 0.1})
             elif fun == 'cube':
                 fun = Cube()
             # Get the final gradient norm