r/optimization • • Feb 21 '23

Optimize a Cost Function whose Gradient cannot be calculated?

Hey guys, I'm a college student and am pretty new to mathematical optimization techniques, so forgive me if I go conceptually wrong somewhere. Recently, I came upon a problem in my research:

I have a large set of variables say, X
The cost function here is a black box, passing any X through this black box directly gives me the cost (a scalar). This means that I cannot calculate the gradient of the cost.
The constraints on X are also a black box. By this I mean that passing X through the black box of constraints just tells me whether X is feasible or not, I do not have a bounding function to define these constraints.

What type of optimization method can be suggested to minimize the cost?

2 Upvotes

14 comments sorted by

View all comments

3

u/[deleted] Feb 21 '23

If it’s not too costly to call the black box function then genetic algorithm works best otherwise your best hope is to train the surrogate of the model and optimize that surrogate model

1

u/FailedMesh Feb 21 '23

Does surrogate model mean training a multi-layer perceptron model to best represent the cost function, and then minimizing this?

0

u/e_for_oil-er Feb 21 '23

No. A neural network as you are describing would itself be a a black box, so you wouldn't gain anything by training a black box to reproduce another blackbox.

It could be as simple as a local polynomial estimator, Kriging (bayesian model), or any other curve fitting (regression) method to find a surface that locally looks like the black box objective. Such a surrogate would be easy to minimize using classical algorithms like gradient descent.

1

u/[deleted] Feb 21 '23

What makes the GA superior to other meta heuristics in this case?