Skip to main content

Moon, Make MOO great again

Project description

Moon: A Standardized/Flexible Framework for MultiObjective OptimizatioN

'' I raise my cup to invite the moon. With my shadow we become three from one. '' -- Li Bai.

Moon: is a multiobjective optimization framework, from single-objective optimization to multiobjective optimization, towards a better understanding of optimization problems and fair comparasions between MOO algorithms.

Main contributors: Xiaoyuan Zhang (project leader), Ji Cheng, Liao Zhang, Weiduo Liao, Zhe Zhao, Xi Lin, Cheng Gong, Longcan Chen.

Advised by: Prof. Yifan Chen, Prof. Zhichao Lu, Prof. Ke Shang, Prof. Tao Qin.

Corresponding to: Prof. Qingfu Zhang (CityU HK).

(1) A standardlized gradient based framework.

  • Problem class. For more problem details, please also check the Readme_problem.md file. (i) For synthetic problems,
  • Problem Paper Project/Code
    ZDT paper project
    DTLZ [paper] project
    MAF paper [project]
    WFG code Real world problems. Y
    Fi's code Real world problems. Y
    RE paper code

(2) For multitask learning problems,

Problem Paper Project/Code
MO-MNISTs PMTL COSMOS
Fairness Classification COSMOS COSMOS
Federated Learning

(3) For MORL problems,

Problem Paper Project/Code
Synthetic (DST FTS...) Envelop code
Robotics (MO-MuJoCo...) PGMORL code
  • Gradient-based Solver.

    Method Property #Obj Support Published Complexity
    EPO code Exact solution. Any Y ICML 2020 $O(m^2 n K )$
    COSMOS code Approximated exact solution. Any Y ICDM 2021 $O(m n K )$
    MOO-SVGD code A set of diverse Pareto solution. Any Y NeurIPS 2021 $O(m^2 n K^2 )$
    MGDA code Arbitray Pareto solutions. Location affected highly by initialization. Any Y NeurIPS 2018 $O(m^2 n K )$
    PMTL code Pareto solutions in sectors. 2. 3 is difficult. Y NeurIPS 2019 $O(m^2 n K^2 )$
    PMGDA Pareto solutions satisfying any preference. Any Y Under review $O(m^2 n K )$
    GradienHV WangHao code It is a gradient-based HV method. 2/3 Y CEC 2023 $O(m^2 n K^2 )$
    Aggregation fun. based, e.g. Tche,mTche,LS,PBI,... Pareto solution with aggregations. Any Y

    Here, $m$ is the number of objectives, $K$ is the number of samples, and $n$ is the number of decision variables. For neural network based methods, $n$ is the number of parameters; hence $n$ is very large (>10000), K is also large (e.g., 20-50), while $m$ is small (2.g., 2-4).

    As a result, m^2 is not a big problem. n^2 is a big problem. K^2 is a big problem.

    Time complexity of gradient based methods are as follows, -1 Tier 1. GradAggSolver. -2 Tier 2. MGDASolver, EPOSolver, PMTLSolver. -3 Tier 3. GradHVSolver -4 Tier 4. MOOSVGDSolver

    Current support: GradAggSolver, MGDASolver, EPOSolver, MOOSVGDSolver, GradHVSolver, PMTLSolver.

    Important things to notice: The original code MOO-SVGD does not offer a MTL implement. Our code is the first open source code for MTL MOO-SVGD.

  • PSL solvers

    • EPO-based
    • Agg-based
    • Hypernetwork-based
    • ConditionalNet-based
    • Simple PSL model
    • Generative PSL model
  • MOEA/D Current supported:

  • ML pretrained methods.

Example code:

from libmoon.solver.gradient import GradAggSolver
from libmoon.util_global.constant import problem_dict
from libmoon.util_global.weight_factor.funs import uniform_pref
import torch
import numpy as np
from matplotlib import pyplot as plt
import argparse
from libmoon.visulization.view_res import vedio_res

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='example')
    parser.add_argument('--n-partition', type=int, default=10)
    parser.add_argument('--agg', type=str, default='tche')  # If solve is agg, then choose a specific agg method.
    parser.add_argument('--solver', type=str, default='agg')
    parser.add_argument('--problem-name', type=str, default='VLMOP2')
    parser.add_argument('--iter', type=int, default=1000)
    parser.add_argument('--step-size', type=float, default=1e-2)
    parser.add_argument('--tol', type=float, default=1e-6)
    args = parser.parse_args()
    
    
    # Init the solver, problem and prefs. 
    solver = GradAggSolver(args.step_size, args.iter, args.tol)
    problem = problem_dict[args.problem_name]
    prefs = uniform_pref(args.n_partition, problem.n_obj, clip_eps=1e-2)
    args.n_prob = len(prefs)

    # Initialize the initial solution 
    if 'lbound' in dir(problem):
        if args.problem_name == 'VLMOP1':
            x0 = torch.rand(args.n_prob, problem.n_var) * 2 / np.sqrt(problem.n_var) - 1 / np.sqrt(problem.n_var)
        else:
            x0 = torch.rand(args.n_prob, problem.n_var)
    else:
        x0 = torch.rand( args.n_prob, problem.n_var )*20 - 10


    # Solve results
    res = solver.solve(problem, x=x0, prefs=prefs, args=args)
    
    # Visualize results
    y_arr = res['y']
    plt.scatter(y_arr[:,0], y_arr[:,1], s=50)
    plt.xlabel('$f_1$', fontsize=20)
    plt.ylabel('$f_2$', fontsize=20)
    plt.show()
    
    # If use vedio
    use_vedio=True
    if use_vedio:
        vedio_res(res, problem, prefs, args)

    

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

libmoon-0.1.11.tar.gz (65.7 kB view hashes)

Uploaded Source

Supported by

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