Skip to content

Commit

Permalink
new branch
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhang2523 committed Feb 17, 2025
1 parent 566f85a commit 97e58e3
Show file tree
Hide file tree
Showing 51 changed files with 750 additions and 2,914 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ Xuehai Pan, Hongzong Li, Zhe Zhao, Meitong Liu, Weiduo Liao, Baijiong Lin, Weiyu
- QQ group:

<p align="center">
<img src="img/qq.jpg" alt="Moon" width="200">
<img src="img/qq_group.jpg" alt="Moon" width="200">
</p>

- Wechat group:
<p align="center">
<img src="img/wechat.jpg" alt="Moon" width="200">
<img src="img/wechat_group.jpg" alt="Moon" width="200">
</p>

- Slack group: https://cityu-hiv5987.slack.com/archives/C07GU3N2H2S
Expand Down
Binary file removed img/LibmoonLogo.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed img/supported_methods.png
Binary file not shown.
File renamed without changes
56 changes: 56 additions & 0 deletions libmoon/auto_tester/test_synthetic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from libmoon.solver.gradient.methods.base_solver import GradAggSolver
from libmoon.solver.gradient.methods.epo_solver import EPOSolver
from libmoon.solver.gradient.methods.mgda_solver import MGDAUBSolver
from libmoon.solver.gradient.methods.pmgda_solver import PMGDASolver
from libmoon.solver.gradient.methods.moosvgd_solver import MOOSVGDSolver
from libmoon.solver.gradient.methods.gradhv_solver import GradHVSolver
from libmoon.solver.gradient.methods.pmtl_solver import PMTLSolver
from libmoon.problem.synthetic.zdt import ZDT1
from libmoon.problem.synthetic.vlmop import VLMOP1
from libmoon.util import get_uniform_pref, get_x_init
from matplotlib import pyplot as plt
from time import time
import argparse


if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--n-epoch', type=int, default=20000)
# Tested. GradAggSolver, EPOSolver, MGDAUBSolver, PMGDASolver, MOOSVGDSolver
parser.add_argument('--solver-name', type=str, default='PMTL')

solver_dict = {
'PMGDA': PMGDASolver,
'EPO': EPOSolver,
'MOOSVGD': MOOSVGDSolver,
'GradHV': GradHVSolver,
'PMTL': PMTLSolver,
}
solver = solver_dict[parser.parse_args().solver_name]
args = parser.parse_args()
problem = VLMOP1(n_var=10)
n_probs = 10
prefs = get_uniform_pref(n_probs, problem.n_obj, clip_eps=0.1)
solver = solver_dict[args.solver_name](problem, prefs, n_epoch=args.n_epoch, step_size=1e-3, tol=1e-3)
x_init = get_x_init(n_probs, problem.n_var, lbound=problem.lbound, ubound=problem.ubound)
ts = time()
res = solver.solve(x_init=x_init)
ts = time() - ts
y = res['y']
fig, axes = plt.subplots(2, 1, figsize=(5, 10))
axes[0].scatter(y[:, 0], y[:, 1])
axes[0].set_title(solver.solver_name, fontsize=20)

axes[0].set_xlabel('$f_1$', fontsize=20)
axes[0].set_ylabel('$f_2$', fontsize=20)

# Line plot in the second subplot (axes[1])
axes[1].plot(res['hv_history'], linewidth=2)
axes[1].set_title('HV History', fontsize=20)

axes[1].set_xlabel('Epoch', fontsize=20)
axes[1].set_ylabel('Hypervolume', fontsize=20)
# Show the plot
plt.tight_layout()
print('elapsed :{:.2f}'.format(ts / 5000) )
plt.show()
1 change: 1 addition & 0 deletions libmoon/gan_tester/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This folder is for another submission.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions libmoon/problem/morl/deep_sea_treasure.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import absolute_import, division, print_function
import numpy as np


class DeepSeaTreasure(object):

def __init__(self):
Expand Down
1 change: 1 addition & 0 deletions libmoon/problem/morl/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
These problems have been not complete yet.
Loading

0 comments on commit 97e58e3

Please sign in to comment.