Synthetic Benchmarks¶
The Synthetic benchmark collection includes classic mathematical test functions commonly used in optimization research.
Available Problems¶
bocode.Synthetics.Ackleybocode.Synthetics.Bukinbocode.Synthetics.DixonPricebocode.Synthetics.Goldsteinbocode.Synthetics.Goldstein_Discretebocode.Synthetics.Griewankbocode.Synthetics.Levybocode.Synthetics.Michalewiczbocode.Synthetics.Powellbocode.Synthetics.Rastriginbocode.Synthetics.Rosenbrockbocode.Synthetics.Styblinski-Tangbocode.Synthetics.Bealebocode.Synthetics.Cosine8bocode.Synthetics.DropWavebocode.Synthetics.EggHolderbocode.Synthetics.Hartmann3Dbocode.Synthetics.Hartmann6Dbocode.Synthetics.HolderTablebocode.Synthetics.Shekelm5bocode.Synthetics.Shekelm7bocode.Synthetics.Shekelm10bocode.Synthetics.Shekelbocode.Synthetics.SixHumpCamelbocode.Synthetics.ThreeHumpCamelbocode.Synthetics.ConstrainedGramacybocode.Synthetics.ConstrainedHartmannbocode.Synthetics.ConstrainedHartmannSmoothbocode.Synthetics.PressureVesselbocode.Synthetics.WeldedBeamSObocode.Synthetics.TensionCompressionStringbocode.Synthetics.SpeedReducerbocode.Synthetics.SVM
Example Usage¶
import bocode
import torch
# Create a synthetic benchmark problem
problem = bocode.Synthetics.Goldstein_Discrete()
# Evaluate at a point
x = torch.Tensor([[0.0] * problem.dim])
values, constraints = problem.evaluate(x)
print(f"Goldstein Discrete function value at origin: {values[0]}")
Output:
Goldstein Discrete function value at origin: tensor([-600.])