i am trying to optimize (minimize to be more specific) a function using python. The standard way led me to using scipy.optimize.minimize. However, i have a large number of variables with individual constraints that obey the same function to be minimized (~ 100,000).
The function itself is not fully analytical, as it involves some prediction using neural networks. In order to speed things up and to reduce memory consumption it would be very beneficial if all variables could be optimized in parallel (such that the processing, like the ML prediction is done in parallel). The task is doable with multiprocessing, but i believe it would be much faster if it could be vectorized.
The fact that all variables can be treated independently should make this doable.
Does anyone know if there is a package similar to scipy.optimize.minimize that is able to minimize a vector-output function with a large number of independent variables (ideally with the flexibility to incorporate constraints and bounds for each variable)?
In order to clarify what i am intending: I want multiple parallel optimizations, where all variables of one optimization are independent of all other optimization. Ideally this would be formulated in a vectorized manner, by means of a multivariate-multiobjective constrained minimization procedure. Imaging the following example:
You have food diaries of ~100,000 people and you use pandas.DataFrame to handle the data and you trained some ML model to predict if the food is good for each individuals. Clearly this task would be faster to operate vectorized than in a for-loop for every individual.
Now assume that you want to vary some of the features in the food diary, e.g., to find the optimum dose or quantity for some of the items (this is what you would like to optimize). And this is clearly independent of all other individuals.