Disable warnings in vmap or print to stderr
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 76
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 1
Description
When running a solver like `BFGS` or similar, the code runs fine without warnings if I call it directly. But, if I call it inside a `vmap` then I get spammed by warnings that are not too problematic for my use-case.
I also cannot filter the warnings directly, since the warnings do not print to stderr but to stdout... (at least I think so). I wasn't able to filter the warnings with:
```python
warnings.filterwarnings('ignore', '.*jaxopt.ZoomLineSearch.*')
```
This is super annoying when logging other information to stdout in my tests, how can I get rid of this?
```python
WARNING: jaxopt.ZoomLineSearch: Very large absolute slope at stepsize=0. (|slope|=0.06082260608673096). The objective is badly conditioned. Consider reparameterizing objective (e.g., normalizing parameters) or finding a better guess for the initial parameters for the solver.
WARNING: jaxopt.ZoomLineSearch: Very large absolute slope at stepsize=0. (|slope|=0.062071025371551514). The objective is badly conditioned. Consider reparameterizing objective (e.g., normalizing parameters) or finding a better guess for the initial parameters for the solver.
WARNING: jaxopt.ZoomLineSearch: Very large absolute slope at stepsize=0. (|slope|=0.05304361507296562). The objective is badly conditioned. Consider reparameterizing objective (e.g., normalizing parameters) or finding a better guess for the initial parameters for the solver.
WARNING: jaxopt.ZoomLineSearch: Cannot even make a step without getting Inf or Nan. The linesearch won't make a step and the optimizer is stuck.
WARNING: jaxopt.ZoomLineSearch: Making an unsafe step, not decreasing enough the objective. Convergence of the solver is compromised as it does not reduce values.
...
```
Contributor guide
Assessment
This issue has not been assessed yet.