Closed Stefan-Endres closed 3 years ago
Why not just use functools.lru_cache
?
I wanted to discuss this at some point.
The algorithm ensures convergence (and other properties) for non-continuous functions (even large domains of the search space the objective function does not necessarily need to be defined as long as there exists an arbitrarily small continuous subdomain) as long as the 'simplicial'
sampling method is used.
The proof depends on defining points of discontinuity as being mapped to infinity. For this I use numpy.inf
for any constraint violations.
Ideally I would like to convert any non-float value outputs such as None
values and other objects from the objective function to numpy.inf
.
However, other problems can arise such as division by zero stopping the algorithm.
So our options are:
triangulation.py
.numpy.inf
at the discontinuities. The first option appears more robust, however, the second option allows more control.
Implemented 1 with cc51c2348f239b6378ac00e5768832f51c66fe61.
Incorporate the FunctionCache class from pointclasses.py into the main code. While the global routine will not evaluate the same value twice (and it is very unlikely that a non-deterministic local minimization would), it will allow us to reduce some complexity in the random sampling code to make it more similar to the simplicial sampling.