google / jaxopt

Hardware accelerated, batchable and differentiable optimizers in JAX.
https://jaxopt.github.io
Apache License 2.0
939 stars 66 forks source link

Should `solve_inv` be `solve_pinv` ? #309

Open GeoffNN opened 2 years ago

GeoffNN commented 2 years ago

I'm looking at https://github.com/google/jaxopt/blob/ddd6c30953f6c02d8022c1358aa67d9114aed3a6/jaxopt/_src/linear_solve.py#L93

In most cases, when solving a linear system, we're interested in using the pseudo inverse. Should the call be to jnp.linalg.pinv instead of inv ?

mblondel commented 2 years ago

I think we can keep solve_inv and create a new solve_pinv in addition.