Skip to main content

Data-Driven Multitask Optimization Laboratory

Project description

Data-Driven Multitask Optimization Laboratory

DDMTOLab Logo

Documentation PyPI version Downloads GitHub Stars Python Version License


📖 Overview

DDMTOLab (Data-Driven Multitask Optimization Laboratory) is a comprehensive Python platform for optimization research, featuring 60+ 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, DDMTOLab provides a flexible and extensible framework to accelerate your research and support real-world applications.

✨ Features

  • 🚀 Comprehensive Algorithms - 60+ 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

DDMTOLab 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 (60+)

Category Description Algorithms
STSO Single-task single-objective GA, DE, PSO, SL_PSO, KL_PSO, CSO, CMA_ES, IPOP_CMA_ES, sep_CMA_ES, MA_ES, xNES, OpenAI_ES, AO, GWO, EO, BO, EEI_BO, ESAO, SHPSO, SA_COSO, TLRBF, GL_SADE
STMO Single-task multiobjective 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, MCEA_D, CPS_MOEA, ParEGO, K_RVEA, DSAEA_PS, KTA2, REMO
MTSO Multitask single-objective MFEA, MFEA_II, EMEA, EBS, G_MFEA, MTEA_AD, MKTDE, MTEA_SaO, SREMTO, LCB_EMT, MTBO, RAMTEA, SELF, EEI_BO_plus, MUMBO, BO_LCB_CKT, BO_LCB_BCKT
MTMO Multitask multiobjective MO_MFEA, MO_MFEA_II, MO_EMEA, MO_MTEA_SaO, MTDE_MKTA, MTEA_D_DN, EMT_ET, EMT_PD, 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)
MTMO CEC17_MTMO (9), CEC19_MTMO (10), CEC19_MaTMO (many-task), CEC21_MTMO (10), MTMO_DTLZ
Real-World PEPVM, PINN_HPO (12), SOPM, SCP, MO_SCP, PKACP

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 DDMTOLab in your research, please cite:

@software{ddmtolab2025,
  author = {Jiangtao Shen},
  title = {DDMTOLab: 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.5.tar.gz (1.8 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.5-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ddmtolab-1.0.5.tar.gz
  • Upload date:
  • Size: 1.8 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.5.tar.gz
Algorithm Hash digest
SHA256 ef2309e6be800217d3c2e68ff04232c6a9fc9b2159e248bf1d11eccbee1cbdad
MD5 a4c225c7c442cc175f5fec41e8f6eaeb
BLAKE2b-256 bf90f7256f8668b77ebcdee86cbc4410273f4a1e6efc8b5794122eafa925658b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ddmtolab-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 2.1 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6678e49f4b30e3685903eab15a9ef8a3fca04705d90b366f5656b60051fcf7d8
MD5 45783ebdef54f1a075d16e2f354d8188
BLAKE2b-256 af1e11152cb76f3d8e63bd1dfb2cf33f8216d9d9d676d0962b4bd471dffaa2f7

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