xzhang2523 / libmoon

LibMOON is a standard and flexible framework to study gradient-based multiobjective optimization.
https://pypi.org/project/libmoon/
MIT License
53 stars 1 forks source link
baysian-optimisation multiobjective-learning multiobjective-optimization multitask-learning optimization-algorithms reinforcement-learning
Model

LibMOON: A Gradient-based MultiObjective OptimizatioN Library in PyTorch

Documentation Status License: MIT PyPI version Supported Python versions Hits Made With Friends Paper

LibMOON is an open-source library built on PyTorch for gradient based MultiObjective (MOO). See the latest documentation for detailed introductions and API instructions.

Star or fork us on GitHub — it motivates us a lot!

News

1. LibMOON Supported Problems

1.1 Synthetic Problems

LibMOON supports a large number of synthetic problems, including ZDT, DTLZ, RE, MAF, WFG, Fi and UF problems.

1.2 Multiobjective Multitask Learning (MO-MTL) Problems

Method $L_1$ $L_2$
Fairness classification Binary cross entropy DEO
Multiobjective classification Cross entropy loss BR Cross entropy loss UL
MO machine learning Mean square loss Mean square loss
MO distribution alignment Similarity 1 Similarity 2

Notes:

2. LibMOON Supported Solvers

LibMOON includes a variety of solvers tailored for different needs as image below shows.

2.1 Finite solution solvers

Method Property Paper Complexity
EPO (Mahapatra et al 2020) Exact solutions paper $O(m^2nK)$
MGDA-UB (Sener et al 2018) Arbitrary solutions paper $O(m^2nK)$
PMGDA (Zhang et al 2024) Specific solutions paper $O(m^2nK)$
Random (Lin et al 2021) Arbitrary solutions paper $O(m^2nK)$
MOO-SVGD (Liu et al 2021) Diverse solutions paper $O(m^2nK^2)$
PMTL (Lin et al 2019) Sector solutions paper $O(m^2nK^2)$
HVGrad (Deist et al 2021) Maximal HV solutions paper $O(m^2nK^2)$
Agg-LS (Miettinen et al 1999) Convex hull solutions book $O(mnK)$
Agg-Tche (Zhang et al 2007) Exact solutions paper $O(mnK)$
Agg-mTche (Ma et al 2017) Exact solutions paper $O(mnK)$
Agg-PBI (Zhang et al 2007) Approximate exact solutions paper $O(mnK)$
Agg-COSMOS (Ruchte et al 2007) Approximate exact solutions paper $O(mnK)$
Agg-SoftTche (Lin et al 2024) Fast approximate exact solutions paper $O(mnK)$

Notations:

In neural network methods, $n$ is very large (>10,000), $K$ is also large (e.g., 20-50), and $m$ is relatively small (e.g., 2-4). Consequently, $m^2$ is not a significant issue, but $n^2$ and $K^2$ are major concerns.

2.2 Pareto set learning(PSL) Solvers

LibMOON supports various models of PSL solvers, categorized as follows:

Method Property Paper
EPO-based PSL (Navon et al 2021) Exact solutions paper
PMGDA-based PSL (Zhang et al 2024) Specific solutions paper
Aggregation-baed PSL (Sener et al 2018) Minimal aggregation function solutions paper
Evolutionary PSL (Sener et al 2018) Mitigate local minimal by ES paper
LoRA PSL (Chen et al 2024) Light model structure paper

2.3 MultiObjective Bayesian Optimization (MOBO) Solvers

3. Installation and quick start

Libmoon is available on PyPI. You can install it using pip:

pip install libmoon==0.1.11
from libmoon.solver.gradient.methods import EPOSolver
from libmoon.util.synthetic import synthetic_init
from libmoon.util.prefs import get_uniform_pref
from libmoon.util import get_problem

problem = get_problem(problem_name='ZDT1')
prefs = get_uniform_pref(n_prob=5, n_obj=problem.n_obj, clip_eps=1e-2)
solver = EPOSolver(step_size=1e-2, n_iter=1000, tol=1e-2, problem=problem, prefs=prefs)
res = solver.solve(x=synthetic_init(problem, prefs))
from libmoon.solver.psl.core_psl import BasePSLSolver
from libmoon.util import get_problem
from libmoon.util.prefs import get_uniform_pref
from torch import Tensor

problem = get_problem(problem_name='ZDT1')
# agg list [ ’ls ’, ’tche ’, ’mtche ’, ’pbi ’, ... ]
prefs = get_uniform_pref(n_prob=100, n_obj=problem.n_obj, clip_eps=1e-2)
solver = BasePSLSolver(problem, solver_name='agg_ls')
model, _ = solver.solve()
eval_y = problem.evaluate(model(Tensor(prefs).cuda()))

4. Citing LibMOON and Acknowledgements

4.1 If you find our code useful, please cite our codebase:

@misc{zhang2024libmoon,
      title={LibMOON: A Gradient-based MultiObjective OptimizatioN Library in PyTorch}, 
      author={Xiaoyuan Zhang and Liang Zhao and Yingying Yu and Xi Lin and Zhenkun Wang and Yifan Chen and Han Zhao and Qingfu Zhang},
      year={2024},
      eprint={2409.02969},
      archivePrefix={arXiv},
      primaryClass={cs.MS},
      url={https://arxiv.org/abs/2409.02969}, 
}

4.2 Main Contributors

Name Institution Role
*Xiaoyuan Zhang ()** CityUHK Pareto set learning/MOO solvers/Project lead
*Liang Zhao ()** CityUHK MOBO
*Yingying Yu ()** CityUHK Software design
Xi Lin CityUHK Software design

(*): The first three authors contribute equally to this work.

4.3 Advisory Board

We sincernely thank the following contributors for their valuable contributions or feedbacks. We also want thanks for our collobrators from XDU, SZU, SUSTech, ECNU, NEU, SEU for their early use of our code.

We also espeically thank for the following contributors: Xuehai Pan, Hongzong Li, Zhe Zhao, Meitong Liu, Weiduo Liao, Baijiong Lin, Weiyu Chen, Prof. Jingda Deng, Prof. Yifan Chen, Prof. Ke Shang, Prof. Genghui Li, Prof. Han Zhao, Prof. Zhenkun Wang, Prof. Tao Qin, and Prof. Qingfu Zhang (Corresponding) .

4.4 Projects using LibMOON

(1) A telecommunication project.

(2) Two top conference papers recent submitted.

4.5 Contact

LibMOON is not allowed for commercial use without permission. For commerical use, please contact Xiaoyuan Zhang or Prof. Qingfu Zhang.

4.6 Star History

Star History Chart