I have a differentiable function $\mathbb{R}^n \to \mathbb{R} $ of several variables $f(x_1,\ldots,x_n)$, whose form I can write down and compute derivatives of. Typically $n = 8$.
The function is unbounded from below, going to negative infinity when some of the variables go to infinity, and also has a few local minima. I can specify a box in $\mathbb{R}^n$ which I know contains all the local minima, however, it also contains regions towards the corners of the box where the function is already smaller than at these local minima (i.e those corners are already on the "cliff" where $f$ falls off to infinity at large values of the inputs).
The problem: I am looking for an efficient algorithm, implemented in Python, to find the value of the inputs $(x_1^*,\ldots,x_n^*)$ corresponding to the smallest value of $f$ amongst these local minima, where I specify the box as my bounds.
Let us assume that the basin of attraction of the local minimum occupies some volume that is an order 1 fraction of the volume of the bounding box - i.e., my guess about the bounds containing the local minima is not too conservative.
Some reflections:
Note that a differential optimization algorithm to find the global minimum will not work here, as the global minimum of $f$ within the box is not a local minimum of $f$.
One idea is to try $G$ initial guesses within the box, and for each do a gradient descent to find the nearest local minimum, stopping after some number of iterations at points $p_i$ ($i=1,\ldots,G)$. Then, eliminate the points $p_i$ which are too close to the faces of the box (as these won't be the local minima), and amongst the remaining ones, choose the one which gives the smallest $f(p_i)$. The issue is one needs to be smart about how the guesses are made, as a uniform sampling would give a complexity like $m^n$ with $m$ the number of sampling points along a given dimension, and this is prohibitive.
Maybe a better idea is to solve the system of $N$ equations $\partial f /\partial x_i = 0 $, which I can write down analytically and express in the form $X = G(X)$, with $X=(x_1,\ldots,x_n)$. This could probably be solved by some iterative method, again with multiple initial guesses, but I am not sure about the details and if convergence is guaranteed.