Skip to main content

Data-Driven Multitask Optimization Laboratory

Project description

Data-Driven Multitask Optimization Laboratory

D²MTOLab Logo

Documentation PyPI version Downloads GitHub Stars Python Version License


📖 Overview

D2MTOLab (Data-Driven Multitask Optimization Laboratory) is a comprehensive Python platform for optimization research, featuring 110+ algorithms, 180+ benchmark problems, and powerful experiment tools for problem definition, algorithm development, and performance evaluation.

Whether you're working on expensive black-box optimization, multiobjective optimization, or complex multitask scenarios, D2MTOLab provides a flexible and extensible framework to accelerate your research and support real-world applications.

✨ Features

  • 🚀 Comprehensive Algorithms - 110+ algorithms for expensive/inexpensive, single/multitask, single/multiobjective, unconstrained/constrained optimization
  • 📊 Rich Problem Suite - 180+ benchmark problems and real-world applications
  • 🤖 Data-Driven Optimization - Surrogate modelling for expensive optimization
  • 🔧 Flexible Framework - Simple API and intuitive workflow for rapid prototyping
  • 🔌 Fully Extensible - Easy to add custom algorithms and problems
  • Parallel Computing - Multi-core support for batch experiments
  • 📈 Powerful Analysis Tools - Built-in visualization and statistical analysis
  • 📝 Complete Documentation - Comprehensive documentation and API reference

🚀 Quick Start

Installation

pip install ddmtolab

Requirements:

  • Python 3.10+
  • PyTorch 2.5+ (supports CPU, GPU optional for acceleration)
  • NumPy 2.0+, SciPy 1.15+, scikit-learn 1.7+
  • Matplotlib 3.10+, Pandas 2.3+

For detailed installation instructions, see Installation Guide.

Basic Usage

import numpy as np
from ddmtolab.Methods.mtop import MTOP
from ddmtolab.Algorithms.MTSO.MTBO import MTBO

# Step 1: Define objective function
def forrester(x):
    """Forrester function: (6x-2)^2 * sin(12x-4)"""
    return (6 * x - 2) ** 2 * np.sin(12 * x - 4)

# Step 2: Create optimization problem
problem = MTOP()
problem.add_task(forrester, dim=1)

# Step 3: Run optimization
results = MTBO(problem).optimize()

# Step 4: Display results
print(f"Best solution: {results.best_decs}")
print(f"Best objective: {results.best_objs}")

# Step 5: Analyze and visualize
from ddmtolab.Methods.test_data_analysis import TestDataAnalyzer
TestDataAnalyzer().run()

Batch Experiment

from ddmtolab.Methods.batch_experiment import BatchExperiment
from ddmtolab.Methods.data_analysis import DataAnalyzer
from ddmtolab.Algorithms.STSO.BO import BO
from ddmtolab.Algorithms.MTSO.MTBO import MTBO
from ddmtolab.Problems.MTSO.cec17_mtso_10d import CEC17MTSO_10D

if __name__ == '__main__':
    # Step 1: Create batch experiment manager
    batch_exp = BatchExperiment(
        base_path='./Data',      # Data save path
        clear_folder=True        # Clear existing data
    )

    # Step 2: Add test problems
    prob = CEC17MTSO_10D()
    batch_exp.add_problem(prob.P1, 'P1')
    batch_exp.add_problem(prob.P2, 'P2')

    # Step 3: Add algorithms with parameters
    batch_exp.add_algorithm(BO, 'BO', n_initial=20, max_nfes=100)
    batch_exp.add_algorithm(MTBO, 'MTBO', n_initial=20, max_nfes=100)

    # Step 4: Run batch experiments
    batch_exp.run(n_runs=20, verbose=True, max_workers=8)

    # Step 5: Run data analysis
    analyzer = DataAnalyzer()
    results = analyzer.run()

Optimization Process Visualization

D2MTOLab provides built-in animation tools to visualize the optimization process:

from ddmtolab.Problems.MTSO.cec17_mtso_10d import CEC17MTSO_10D
from ddmtolab.Algorithms.STSO.BO import BO
from ddmtolab.Algorithms.MTSO.MTBO import MTBO
from ddmtolab.Methods.animation_generator import create_optimization_animation

# Define problem
problem = CEC17MTSO_10D().P1()

# Run algorithms
BO(problem, n_initial=20, max_nfes=100, name='BO').optimize()
MTBO(problem, n_initial=20, max_nfes=100, name='MTBO').optimize()

# Generate animation
animation = create_optimization_animation(max_nfes=100, merge=2, title='BO vs MTBO')

BO and MTBO on CEC17-MTSO-10D-P1 Animation

🎯 Key Components

Algorithms (110+)

Category Type Algorithms
STSO Inexpensive GA, DE, PSO, SL_PSO, KLPSO, CSO, CMA_ES, IPOP_CMA_ES, sep_CMA_ES, MA_ES, xNES, OpenAI_ES, AO, GWO, EO
STSO Expensive BO, EEI_BO, ESAO, SHPSO, SA_COSO, TLRBF, GL_SADE, AutoSAEA, DDEA_MESS, LSADE
STMO Inexpensive NSGA_II, NSGA_III, NSGA_II_SDR, SPEA2, MOEA_D, MOEA_DD, MOEA_D_FRRMAB, MOEA_D_STM, RVEA, IBEA, TwoArch2, MSEA, C_TAEA, CCMO
STMO Expensive ParEGO, K_RVEA, DSAEA_PS, KTA2, REMO, ADSAPSO, CSEA, DISK, DRLSAEA, DirHV_EI, EDN_ARMOEA, EIM_EGO, EM_SAEA, KTS, MGSAEA, MMRAEA, MOEA_D_EGO, MultiObjectiveEGO, PCSAEA, PEA, PIEA, SAEA_DBLL, SSDE, TEA, CPS_MOEA, MCEA_D
MTSO Inexpensive MFEA, MFEA_II, EMEA, EBS, G_MFEA, MTEA_AD, MKTDE, MTEA_SaO, SREMTO, LCB_EMT, BLKT_DE, DTSKT, EMTO_AI, MFEA_AKT, MFEA_DGD, MFEA_VC, MTDE_ADKT, MTEA_HKTS, MTEA_PAE, MTES_KG, SSLT_DE, TNG_SNES
MTSO Expensive MTBO, RAMTEA, SELF, EEI_BO_plus, MUMBO, BO_LCB_CKT, BO_LCB_BCKT, MFEA_SSG, SaEF_AKT
MTMO Inexpensive MO_MFEA, MO_MFEA_II, MO_EMEA, MO_MTEA_SaO, MTDE_MKTA, MTEA_D_DN, EMT_ET, EMT_PD, EMT_GS, MO_MTEA_PAE, MO_SBO, MTEA_D_TSD, MTEA_DCK
MTMO Expensive ParEGO_KT

Problems (180+)

Category Problem Suites
STSO CLASSICALSO (8 functions), CEC10_CSO (20 functions)
STMO ZDT (6), DTLZ (9), WFG (9), UF (10), CF (10), MW (14)
MTSO CEC17_MTSO (9), CEC17_MTSO_10D (9), CEC19_MaTSO (many-task), CMT (9), STOP (12), ManyTask_10D (4)
MTMO CEC17_MTMO (9), CEC19_MTMO (10), CEC19_MaTMO (many-task), CEC21_MTMO (10), MTMO_DTLZ, MTMOInstances
Real-World PEPVM, PINN_HPO (12), SOPM, SCP, MO_SCP, PKACP, NN_Training, TSP (6)

Methods

  • MTOP Class: Flexible problem definition supporting single/multitask and single/multiobjective
  • Batch Experiments: Parallel execution framework for large-scale experiments
  • Data Analysis: Statistical analysis (mean, std, ranking) and visualization tools
  • Performance Metrics: IGD, GD, IGD+, HV, DeltaP, Spacing, Spread, FR, CV
  • Animation Generator: Optimization process visualization
  • Algorithm Utilities: Reusable components (initialization, selection, operators)

📚 Documentation

📄 Citation

If you use D2MTOLab in your research, please cite:

@software{ddmtolab2025,
  author = {Jiangtao Shen},
  title = {D$^2$MTOLab: A Python Platform for Data-Driven Multitask Optimization},
  year = {2025},
  url = {https://github.com/JiangtaoShen/DDMTOLab}
}

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📧 Contact

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

Made with ❤️ by Jiangtao Shen

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ddmtolab-1.0.9.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ddmtolab-1.0.9-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file ddmtolab-1.0.9.tar.gz.

File metadata

  • Download URL: ddmtolab-1.0.9.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for ddmtolab-1.0.9.tar.gz
Algorithm Hash digest
SHA256 97492902d48ac2edd4eee92d43bf7f1834edc90d812a981f6d5aa398620d5b34
MD5 233d267da8ad625ec115b59924a218f0
BLAKE2b-256 5c1a6df9d26757920f6fa077d01d8d6e3d47de523c8515c442e9cf814109431b

See more details on using hashes here.

File details

Details for the file ddmtolab-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: ddmtolab-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for ddmtolab-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b14fa5d2851a5cb8c003e7e8eb33a734cbfc902f7aa0a7baca9d612dda16dfb5
MD5 f6beca3faae407b8eae271e381ed87c3
BLAKE2b-256 adbfc322a6edc24e2ab2fd9fccd4700247f44f516330c09e62f57997084ff311

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page