Package: libmoon
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.Problemclass. For more problem details, please also check the Readme_problem.md file.
(i) For synthetic problems,ProblemPaperProject/CodeZDTpaperprojectDTLZ[paper]projectMAFpaper[project]WFGcodeReal world problems.YFi'scodeReal world problems.YREpapercode(2) For multitask learning problems,ProblemPaperProject/CodeMO-MNISTsPMTLCOSMOSFairness ClassificationCOSMOSCOSMOSFederated Learning(3) For MORL problems,ProblemPaperProject/CodeSynthetic (DST FTS...)EnvelopcodeRobotics (MO-MuJoCo...)PGMORLcodeGradient-based Solver.MethodProperty#ObjSupportPublishedComplexityEPOcodeExact solution.AnyYICML 2020$O(m^2 n K )$COSMOScodeApproximated exact solution.AnyYICDM 2021$O(m n K )$MOO-SVGDcodeA set of diverse Pareto solution.AnyYNeurIPS 2021$O(m^2 n K^2 )$MGDAcodeArbitray Pareto solutions. Location affected highly by initialization.AnyYNeurIPS 2018$O(m^2 n K )$PMTLcodePareto solutions in sectors.2. 3 is difficult.YNeurIPS 2019$O(m^2 n K^2 )$PMGDAPareto solutions satisfying any preference.AnyYUnder review$O(m^2 n K )$GradienHVWangHaocodeIt is a gradient-based HV method.2/3YCEC 2023$O(m^2 n K^2 )$Aggregation fun. based, e.g. Tche,mTche,LS,PBI,...Pareto solution with aggregations.AnyYHere, $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. MOOSVGDSolverCurrent 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 solversEPO-basedAgg-basedHypernetwork-basedConditionalNet-basedSimple PSL modelGenerative PSL modelMOEA/DCurrent supported:VanillaMOEA/DWill be released soon:MOEA/D AWA.MOEA/D neural AWA.ML pretrained methods.HV net (https://arxiv.org/abs/2203.02185).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)