Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AGEMOEA2 has too many error when benchmarked by test problems. #620

Open
muazhari opened this issue Jul 17, 2024 · 2 comments
Open

AGEMOEA2 has too many error when benchmarked by test problems. #620

muazhari opened this issue Jul 17, 2024 · 2 comments

Comments

@muazhari
Copy link
Contributor

muazhari commented Jul 17, 2024

from pymoo.termination import get_termination
from pymoo.algorithms.moo.age import AGEMOEA
from pymoo.algorithms.moo.sms import SMSEMOA
from pymoo.util.ref_dirs import get_reference_directions, LayerwiseRieszEnergyReferenceDirectionFactory
from pymoo.algorithms.moo.ctaea import CTAEA
from pymoo.algorithms.moo.age2 import AGEMOEA2
from pymoo.core.variable import Binary, Choice, Integer, Real
from pymoo.core.problem import LoopedElementwiseEvaluation, RayParallelization
from pymoo.algorithms.moo.nsga2 import RankAndCrowding, NSGA2
from pymoo.core.mixed import MixedVariableGA, MixedVariableMating, MixedVariableDuplicateElimination, \
    MixedVariableSampling
from pymoo.optimize import minimize

from pymoo.problems.many import C1DTLZ1, DC1DTLZ1, DC1DTLZ3, DC2DTLZ1, DC2DTLZ3, DC3DTLZ1, DC3DTLZ3, C1DTLZ3, \
    C2DTLZ2, C3DTLZ1, C3DTLZ4, DTLZ1
from pymoo.core.problem import ElementwiseProblem
import ray
import numpy as np


benchmark_algorithms = [
    # SMSEMOA(),
    AGEMOEA2(),
]


benchmark_problems = [
    C1DTLZ1, DC1DTLZ1, DC1DTLZ3, DC2DTLZ1, DC2DTLZ3, DC3DTLZ1, DC3DTLZ3, C1DTLZ3, C2DTLZ2, C3DTLZ1, C3DTLZ4
]



def run_benchmark(problem, algorithm):
    res = minimize(
        problem(),
        algorithm,
        verbose=True,
        seed=1
    )

    result = {
        "problem": problem,
        "algorithm": algorithm,
        "result": res
    }

    return result
    
tasks = []
for problem in benchmark_problems:
    for algorithm in benchmark_algorithms:
        tasks.append(ray.remote(run_benchmark).remote(problem, algorithm))
result = ray.get(tasks) 

Output:
image

@blankjul
Copy link
Collaborator

AGE-MOEA2 was added here #272.

@apanichella
Have you tested the implementation on these test problems as well?

@apanichella
Copy link
Contributor

I did some tests for constraints problem in the original MATLAB implementation and it worked well. I think that happens when there are not enough points for the derivative.

I am doing some tests to check this. A fix will follow later today :)

blankjul pushed a commit that referenced this issue Aug 25, 2024
* Fix overflow and division by zero errors: Add checks to prevent division by zero and apply regularization to avoid extremely large results in exponentiation when the base is too small.

* Add example for AGE-MOEA-II with constrained problems

* Fix NumbaDeprecationWarning in AGE-MOEA and AGE-MOEA-II

* Add additional checks for Inf and NaN values

* Fix more overflow errors

* Adding more overflow checks

* Fixing division-by-zero errors in survival_score(..)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants