User Guide#


Tip

New to Surfaces? Start with Introduction for the fundamentals, then explore the Test Functions to see what’s available.


How Surfaces Works#

Surfaces provides a unified interface for optimization test functions. Each function can be evaluated, returns loss or score values, and provides its search space definition.

Evaluation

Call the function

Evaluate at any point using dictionaries, keyword arguments, or numpy arrays.

Metric

Loss or Score

Results for minimization (loss) or maximization (score). Same function, both modes.

Search Space

Parameter bounds

Every function provides a default search space with appropriate bounds.


Guide Sections#

Introduction

Core concepts and the unified interface. Start here if you’re new to Surfaces.

Introduction
Test Functions

All function categories: Algebraic, BBOB, CEC, Machine Learning, and Engineering.

Test Functions
Modifiers

Modify test functions with noise and other transformations.

Modifiers
Presets

Pre-configured function collections for common benchmarking scenarios.

Collection
Integrations

Use Surfaces with scipy, Optuna, SMAC, Ray Tune, GFO, and Hyperactive.

Integrations
Visualization

Plot function surfaces, contours, and optimization trajectories.

Visualization
Surrogates

Pre-trained models for fast evaluation of expensive ML test functions.

Surrogate Models
Multi-Fidelity

Evaluate ML functions at reduced cost for Hyperband, BOHB and ASHA.

Multi-Fidelity
Compute Units

Hardware-independent cost metric for benchmarking optimizer vs eval cost.

Compute Units
Benchmarking

Compare optimizers systematically with statistical analysis and CD diagrams.

Benchmarking

Quick Example#

from surfaces.test_functions.algebraic import SphereFunction

# 1. Create the function
func = SphereFunction(n_dim=3)

# 2. Evaluate at a point
loss = func({"x0": 1.0, "x1": 2.0, "x2": 3.0})  # 14.0

# 3. Get the search space
space = func.search_space()  # {'x0': array(...), ...}