[Solved] Picard library modifies sklearn FastICA causing it to reject a default value for the `fun` parameter

### Describe the bug

I wrote some code that did not specify a `fun` parameter to FastICA and somehow this default value was rejected

```
  File "/home/louis/dev/arxiv_explorer/benchmark_ica_impls.py", line 84, in <module>                                                                                                                                                                          
    S_sklearn = ica_sklearn.fit_transform(X_whitened2)                                                                                                                                                                                                        
  File "/home/louis/dev/arxiv_explorer/.venv/lib/python3.13/site-packages/sklearn/utils/_set_output.py", line 316, in wrapped                                                                                                                                 
    data_to_wrap = f(self, X, *args, **kwargs)                                                                                                                                                                                                                
  File "/home/louis/dev/arxiv_explorer/.venv/lib/python3.13/site-packages/sklearn/base.py", line 1329, in wrapper                                                                                                                                             
    estimator._validate_params()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/louis/dev/arxiv_explorer/.venv/lib/python3.13/site-packages/sklearn/base.py", line 492, in _validate_params
    validate_parameter_constraints(      
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^                         
        self._parameter_constraints,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                           
        self.get_params(deep=False),                        
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        caller_name=self.__class__.__name__,                
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )                      
    ^                      
  File "/home/louis/dev/arxiv_explorer/.venv/lib/python3.13/site-packages/sklearn/utils/_param_validation.py", line 98, in validate_parameter_constraints
    raise InvalidParameterError(
    ...<2 lines>...                                         
    )                          
sklearn.utils._param_validation.InvalidParameterError: The 'fun' parameter of FastICA must be a str among {'exp', 'cube', 'tanh'} or a callable. Got 'logcosh' instead.
```

I don't want to dwell on it but I find it very confusing because it is a default value and the value that is documented as of 1.8.0, and changing it to the implied `fun` value of "tanh" causes an unset variable error because the `g` variable is not set for a value "tanh"! 

### Steps/Code to Reproduce

```py
from sklearn.decomposition import FastICA

t0 = time.perf_counter()
pca2 = PCA(n_components=N_PCA_COMPONENTS, whiten=True, svd_solver='randomized')
X_whitened2 = pca2.fit_transform(X)
t_pca2 = time.perf_counter() - t0

t0 = time.perf_counter()
ica_sklearn = FastICA(n_components=N_TOPICS, max_iter=200, random_state=42)
S_sklearn = ica_sklearn.fit_transform(X_whitened2)
t_ica_sklearn = time.perf_counter() - t0

print(f"PCA whitening: {t_pca2:.3f}s")
print(f"sklearn FastICA: {t_ica_sklearn:.3f}s")
print(f"Total: {t_pca2 + t_ica_sklearn:.3f}s")
```

### Expected Results

I was comparing the value against picard and my own implementation of FastICA, it works with `fun="exp"` just fine.

### Actual Results

Above

### Versions

```shell
(arxiv_explorer) louis 🌟 ~/dev/arxiv_explorer $ python -c 'import sklearn; sklearn.show_versions()'

System:
    python: 3.13.3 (main, Apr  9 2025, 04:03:52) [Clang 20.1.0 ]
executable: /home/louis/dev/arxiv_explorer/.venv/bin/python3
   machine: Linux-6.8.0-57-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.8.0
          pip: None
   setuptools: None
        numpy: 2.3.5
        scipy: 1.16.3
       Cython: None
       pandas: 2.3.3
   matplotlib: None
       joblib: 1.5.3
threadpoolctl: 3.6.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 20
         prefix: libscipy_openblas
       filepath: /home/louis/dev/arxiv_explorer/.venv/lib/python3.13/site-packages/numpy.libs/libscipy_openblas64_-fdde5778.so
        version: 0.3.30
threading_layer: pthreads
   architecture: Haswell

       user_api: blas
   internal_api: openblas
    num_threads: 20
         prefix: libscipy_openblas
       filepath: /home/louis/dev/arxiv_explorer/.venv/lib/python3.13/site-packages/scipy.libs/libscipy_openblas-b75cc656.so
        version: 0.3.29.dev
threading_layer: pthreads
   architecture: Haswell

       user_api: openmp
   internal_api: openmp
    num_threads: 20
         prefix: libgomp
       filepath: /home/louis/dev/arxiv_explorer/.venv/lib/python3.13/site-packages/scikit_learn.libs/libgomp-e985bcbb.so.1.0.0
        version: None
```

COMMENT:
I cannot reproduce the error using the FastICA docstring example:

https://github.com/scikit-learn/scikit-learn/blob/b0ba8b029c298e0cc545206d2df4757be0ec2ac2/sklearn/decomposition/_fastica.py#L497-L503

(including when I specify `fun='logcosh'`)

Your code to reproduce does not work as you use variables that are not defined. It is also not minimal.

Please provide minimal reproducer: https://scikit-learn.org/dev/developers/contributing.html#how-to-make-a-good-bug-report

Labels: Bug, Needs Reproducible Code