Skip to content

objectives: Information-Theoretic Objectives

This module defines the objective functions that the optimization methods aim to maximize. Use the get_objective method to retrieve an objective function class by its string name.

  • MI, SLogMI, and SchurMI: These classes compute the Mutual Information (MI) between a set of sensing locations \(X\) and a set of objective locations \(X_{objective}\), using the kernel fuunction \(K\):

    • MI: A naive implementation of MI.

    • SLogMI: Uses a numerically stable implementation of MI based on the log-determinant of the covariance matrix.

    • SchurMI: Computes MI using the Schur complement for improved numerical stability and computational efficiency.

  • AOptimal: Computes the A-optimal design metric, which minimizes \(Tr(K(X, X))\).

  • BOptimal: Computes the B-optimal design metric, which minimizes \(-Tr(K(X, X)^{-1})\).

  • DOptimal: Computes the D-optimal design metric, which minimizes \(|K(X, X)|\).

sgptools.methods.get_objective(objective_name)

Retrieves an objective function class by its string name.

Parameters:

Name Type Description Default
objective_name str

The name of the objective function (e.g., 'MI', 'SLogMI').

required

Returns:

Type Description
Type[Objective]

Type[Objective]: The class of the requested objective function.

Raises:

Type Description
KeyError

If the objective name is not found in the registered OBJECTIVES.

Usage
# Get the Mutual Information objective class
MIObjectiveClass = get_objective('MI')
# You can then instantiate it:
# mi_instance = MIObjectiveClass(X_objective=..., kernel=..., noise_variance=...)
Source code in sgptools/objectives.py
def get_objective(objective_name: str) -> Type[Objective]:
    """
    Retrieves an objective function class by its string name.

    Args:
        objective_name (str): The name of the objective function (e.g., 'MI', 'SLogMI').

    Returns:
        Type[Objective]: The class of the requested objective function.

    Raises:
        KeyError: If the objective name is not found in the registered OBJECTIVES.

    Usage:
        ```python
        # Get the Mutual Information objective class
        MIObjectiveClass = get_objective('MI')
        # You can then instantiate it:
        # mi_instance = MIObjectiveClass(X_objective=..., kernel=..., noise_variance=...)
        ```
    """
    if objective_name not in OBJECTIVES:
        raise KeyError(f"Objective '{objective_name}' not found. Available options: {list(OBJECTIVES.keys())}")
    return OBJECTIVES[objective_name]