API: refactor what `initialize` does
mathurinm opened this issue · comments
Currently, it's impossible to check if a datafit computes Lipschitz constants without calling its initialize
method, which is costly.
As discussed IRL with @Badr-MOUFAD, we can solve this by:
- doing only what needs to be done regardless of the solver in
datafit.initialize()
(eg B computation in Cox) - having dedicated methods such as
Quadratic.compute_lipschitz
, which compute it (and store it ? Probably not needed), as we currently do forQuadratic.init_global_lipschitz
.
Each solver can then check easily that a datafit/penalty implements all required methods and then calls them to compute whatever quantities it requires to perform optimization.