Skip to content
Iannick Gagnon edited this page May 20, 2024 · 21 revisions

Description view source

The Sphere function is a commonly used benchmark for testing optimization algorithms. It is defined mathematically as:

$$ f(\vec{x}) = \sum_{i=1}^{d} a_i x_i^2 $$

Where $d$ corresponds to the number of dimensions (Sphere.dimensionality) with a default value of 2. The $\vec a$ parameter is a $1\times d$ real-valued vector that we introduced for flexibility reasons. More specifically, if any $a_i$ is less than zero, saddle points appear, which represent a different optimization challenge. This can be seen in the interactive Desmos version linked below.

Visualization

Here is a link to an interactive Desmos version we created : https://www.desmos.com/3d/wnvkpux9oy

Sphere().visualize()

Features

  1. Unimodality: The function has a single global minimum, making it easier for optimization algorithms to find the optimal solution.
  2. Global minimum: The global minimum is located at $f(x^{*}=<0,...,0>)=0$.
  3. Search space: Typically, it is evaluated over $[-5.12, 5.12]$ for each dimension.
  4. Smoothness: The function is smooth and differentiable, which is advantageous for gradient-based optimization methods.

Discussion

This function is trivial for gradient-based optimizers, but not necessarily for others. As such, it can be used to measure how well an algorithm does compared to a gradient-based alternative. Similarly, a baseline can be established to quantitatively assess the exploration-exploitation properties of various algorithms.

Sources

The Sphere function is a well-known mathematical function used in optimization literature. More information can be found in relevant optimization textbooks and research papers.

Clone this wiki locally