Skip to content

Mission

Base Mission

Mission

Bases: ABC

The Mission class is the central component of the Odyssey library, representing the optimization problem at hand. It is initialized with several key parameters and maintains the training data, which are updated as the optimization process progresses.

Attributes:

  • name (str) –

    The name of the mission.

  • funcs (list) –

    List of functions to be optimized. Each function should take a tensor as input and return a tensor as output. The Objective class can be used to wrap functions.

  • maneuvers (list) –

    List of goals for each function. Each goal can be either 'ascend' (maximize the function) or 'descend' (minimize the function).

  • envelope (Union[list, ndarray, Tensor]) –

    Defines the parameter space for the optimization problem.

__init__

__init__(name: str, funcs: list, maneuvers: list, envelope: Union[list, ndarray, Tensor])

Initializes the Mission class with the given parameters and sets up the logfile.

Parameters:

  • name (str) –

    The name of the mission.

  • funcs (list) –

    List of functions to be optimized.

  • maneuvers (list) –

    List of goals for each function.

  • envelope (Union[list, ndarray, Tensor]) –

    Defines the parameter space for the optimization problem.

read_logfile

read_logfile() -> DataFrame

Reads the logfile and returns it as a pandas DataFrame.

Returns:

  • DataFrame

    pd.DataFrame: The logfile as a pandas DataFrame.

write_to_logfile

write_to_logfile(data: dict)

Writes the given data to the logfile. The data dictionary should match the columns of the logfile. A creation timestamp is automatically added to the data before writing.

Parameters:

  • data (dict) –

    The data to be written to the logfile. Keys should match the logfile columns.

Raises:

  • AssertionError

    If the keys of the data dictionary do not match the logfile columns.