2

It the latest scipy 1.4.1 package we have the BFGS local minimization technique which has as a sub-parameter norm which is set to infinity, the doc says:

norm : float

Order of norm (Inf is max, -Inf is min).

What does this mean? What values can norm take? Should I leave it as Inf, or should I give it some float values and try out which one work better? What happens if I set it to -Inf?

What is the role of this variable in the optimizer?

Community
  • 1
  • 1
user421473
  • 27
  • 1
  • 4
  • 1
    It's probably the value of `p` in `p`-norm, 2 being Euclidean https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.norm.html – Andras Deak -- Слава Україні Mar 07 '20 at 16:23
  • 1
    Although in that case -inf is weird. Probably worth looking at [the reference](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html#rdd2e1855725e-5). – Andras Deak -- Слава Україні Mar 07 '20 at 16:27
  • 1
    It's the stopping-criterion (in combination with param: `gtol`): `Gradient norm must be less than "gtol" before successful termination`. Just think about it as `stop when numpy.linalg.norm(gvec, ord=norm_PARAM) <= gtol_PARAM` (and numpy's docs will show you all the *allowed*, but not necessarily clever values for `ord`). Indeed, `-inf` then looks weird (a convergence in one dimension can stop the whole procedure). Don't change it without understanding the consequences and observing issues related to your use-case with a clear pointer towards the stopping-criterion. – sascha Mar 07 '20 at 16:40
  • The `axis` and `keepdims` parameters dont have to be specificied here only the `ord` right? (since there is no interface for it), so this means that `ord : {non-zero int, inf, -inf, ‘fro’, ‘nuc’}` can take these values right? – user421473 Mar 07 '20 at 16:51
  • Yes, it's implied by `gvec` being a *vector*. – sascha Mar 07 '20 at 16:56

0 Answers0