Skip to main content

dmosopt

Distributed surrogate based multi-objective optimization.

dmosopt is a powerful Python library for performing distributed multi-objective optimization, with a focus on surrogate-based approaches. It provides a flexible and efficient framework for optimizing complex objective functions, especially in scenarios where evaluations are expensive or time-consuming.

Introduction to the dmosopt Optimization API

Key Features

  • Distributed Optimization: dmosopt is designed to run optimization tasks across multiple workers, allowing for efficient parallelization and scalability. It leverages the distwq library for distributed task management.

  • Surrogate Modeling: The library supports various surrogate modeling techniques, such as Gaussian Process Regression (GPR), to approximate the objective function. This enables efficient exploration of the search space without requiring extensive evaluations of the actual objective.

  • Adaptive Sampling: dmosopt implements adaptive sampling strategies to intelligently select the next points to evaluate based on the surrogate model's predictions and uncertainties. This helps balance exploration and exploitation during the optimization process.

  • Flexible Objective Functions: The API allows users to define their own objective functions, which can be single- or multi-objective.

  • Termination Criteria: dmosopt provides configurable termination criteria, such as a maximum number of iterations or a convergence threshold, to control when the optimization process should stop.

  • Detailed recording of model parameters and objectives: the output file format is HDF5, supporting high-performance, parallel data access.

Documentation

Quick start example

import sys, logging
import numpy as np
from dmosopt import dmosopt
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


def zdt1(x):
    ''' This is the Zitzler-Deb-Thiele Function - type A
        Bound: XUB = [1,1,...]; XLB = [0,0,...]
        dim = 30
    '''
    num_variables = len(x)
    f = np.zeros(2)
    f[0] = x[0]
    g = 1. + 9./float(num_variables-1)*np.sum(x[1:])
    h = 1. - np.sqrt(f[0]/g)
    f[1] = g*h
    return f


def obj_fun(pp):
    """ Objective function to be minimized. """
    param_values = np.asarray([pp[k] for k in sorted(pp)])
    res = zdt1(param_values)
    logger.info(f"Iter: \t pp:{pp}, result:{res}")
    return res


def zdt1_pareto(n_points=100):
    f = np.zeros([n_points,2])
    f[:,0] = np.linspace(0,1,n_points)
    f[:,1] = 1.0 - np.sqrt(f[:,0])
    return f

if __name__ == '__main__':
    space = {}
    for i in range(30):
        space['x%d' % (i+1)] = [0.0, 1.0]
    problem_parameters = {}
    objective_names = ['y1', 'y2']
    
    # Create an optimizer
    dmosopt_params = {'opt_id': 'dmosopt_zdt1',
                      'obj_fun_name': 'example_dmosopt_zdt1.obj_fun',
                      'problem_parameters': problem_parameters,
                      'space': space,
                      'objective_names': objective_names,
                      'population_size': 200,
                      'num_generations': 200,
                      'initial_maxiter': 10,
                      'optimizer': 'nsga2',
                      'termination_conditions': True,
                      'n_initial': 3,
                      'n_epochs': 2}
    
    best = dmosopt.run(dmosopt_params, verbose=True)
    if best is not None:
        import matplotlib.pyplot as plt
        bestx, besty = best
        x, y = dmosopt.sopt_dict['dmosopt_zdt1'].optimizer_dict[0].get_evals()
        besty_dict = dict(besty)
        
        # plot results
        plt.plot(y[:,0],y[:,1],'b.',label='evaluated points')
        plt.plot(besty_dict['y1'],besty_dict['y2'],'r.',label='best points')
    
        y_true = zdt1_pareto()
        plt.plot(y_true[:,0],y_true[:,1],'k-',label='True Pareto')
        plt.legend()
        
        plt.savefig("example_dmosopt_zdt1.svg")

In this example:

  1. We define the objective_function that takes a dictionary of parameters and returns the objective value(s).

  2. We specify the parameter_space, indicating the ranges and types of the parameters to optimize.

  3. We create a dictionary dopt_params with the necessary settings, including the objective function, parameter space, number of epochs, and population size.

  4. The opt_id serves a unique namespace for the resulting output file that captures the best solutions as well as various meta data about the optimization progress.

  5. Finally, we call dmosopt.run() with the optimization parameters and retrieve the best parameters and corresponding objective values.

Cite

If you use dmosopt for your published research, we kindly ask you to cite our paper

@online{gressmannJointSurrogateLearning2026,
  title = {Joint {{Surrogate Learning}} of {{Objectives}}, {{Constraints}}, and {{Sensitivities}} for {{Efficient Multi-objective Optimization}} of {{Neural Dynamical Systems}}},
  author = {Gressmann, Frithjof and Raikov, Ivan Georgiev and Kim, Seung Hyun and Gazzola, Mattia and Rauchwerger, Lawrence and Soltesz, Ivan},
  date = {2026-03-22},
  eprint = {2603.20984},
  eprinttype = {arXiv},
  eprintclass = {cs},
  doi = {10.48550/arXiv.2603.20984},
  url = {http://arxiv.org/abs/2603.20984},
  pubstate = {prepublished},
}

Acknowledgements

dmosopt is based on MO-ASMO as described in the following paper:

Gong, W., Q. Duan, J. Li, C. Wang, Z. Di, A. Ye, C. Miao, and Y. Dai (2016), Multiobjective adaptive surrogate modeling-based optimization for parameter estimation of large, complex geophysical models, Water Resour. Res., 52(3), 1984-2008. doi:10.1002/2015WR018230.

Hypervolume computation uses moocore, a high-performance C library for multi-objective optimization utilities, when it is available. moocore provides optimally-efficient hypervolume algorithms (O(n log n) for 2D/3D fronts) via a Python interface, and is used as the preferred backend for exact hypervolume calculation in dmosopt.

Metadata

Release files for dmosopt 0.9.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dmosopt 0.9.5
File Size Uploaded Provenance Actions
dmosopt-0.9.5.tar.gz 1.0 MB Without provenance Details for dmosopt-0.9.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dmosopt 0.9.5
File Interpreter ABI Platform Actions
dmosopt-0.9.5-py3-none-any.whl Python 3 none any Details for dmosopt-0.9.5-py3-none-any.whl

Total release size: 1.2 MB

Release files / dmosopt-0.9.5.tar.gz

Download URL dmosopt-0.9.5.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
a1898ff5c5ff456ac7378b40cc4cfa4a5934ba8ffb2f32ba222866b658f7135c
BLAKE2b-256 checksum
How to use checksums
3f5e97aba35915967ed22edac329750520753f714ed56ba522491f8d6a4bd2ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / dmosopt-0.9.5-py3-none-any.whl

Download URL dmosopt-0.9.5-py3-none-any.whl
Size 155.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
822e6db887fda544f4c91739268ebd6e85132476aeda002b2f7973d8f6db3e13
BLAKE2b-256 checksum
How to use checksums
3bf9cab3851d5198fefc765032023f6269bb24cae078a5274df3f7e930dcea25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for dmosopt 0.9.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page