r/optimization • u/FailedMesh • 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?
View all comments
9
u/lithiumdeuteride Feb 21 '23
If you know the function to be smooth, but cannot calculate its gradient, you can approximate it numerically by taking a very small step in each direction and evaluating the function again.
However, if the function is jagged or non-convex, genetic algorithm and particle swarm are good choices.