Skip to content

Commit 531c4b9

Browse files
author
Julian Blank
committed
Working on usage test fix
1 parent b98b217 commit 531c4b9

File tree

20 files changed

+79
-346
lines changed

20 files changed

+79
-346
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22

3-
from pymoo.algorithms.so_gradient_descent import GradientBasedAlgorithm
3+
from pymoo.algorithms.convex.base import GradientBasedAlgorithm
44

55

66
class Adam(GradientBasedAlgorithm):

pymoo/algorithms/deriv/gradient_descent.py renamed to pymoo/algorithms/convex/base.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,3 @@ def _next(self):
7979

8080
# set the gradient to none to be ready for the next iteration
8181
self.dX = None
82-
83-
84-
class GradientDescent(GradientBasedAlgorithm):
85-
86-
def __init__(self, X, learning_rate=0.005, **kwargs) -> None:
87-
super().__init__(X, **kwargs)
88-
self.learning_rate = learning_rate
89-
90-
def restart(self):
91-
self.learning_rate /= 2
92-
93-
def apply(self):
94-
self.X = self.X - self.learning_rate * self.dX
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from pymoo.algorithms.convex.base import GradientBasedAlgorithm
2+
3+
4+
class GradientDescent(GradientBasedAlgorithm):
5+
6+
def __init__(self, X, learning_rate=0.005, **kwargs) -> None:
7+
super().__init__(X, **kwargs)
8+
self.learning_rate = learning_rate
9+
10+
def restart(self):
11+
self.learning_rate /= 2
12+
13+
def apply(self):
14+
self.X = self.X - self.learning_rate * self.dX

pymoo/algorithms/ctaea.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from pymoo.algorithms.genetic_algorithm import GeneticAlgorithm
77
from pymoo.docs import parse_doc_string
88
from pymoo.factory import get_decomposition
9-
from pymoo.model.individual import Individual
109
from pymoo.model.population import Population
1110
from pymoo.operators.crossover.simulated_binary_crossover import SimulatedBinaryCrossover
1211
from pymoo.operators.mutation.polynomial_mutation import PolynomialMutation

pymoo/algorithms/deriv/base.py

Whitespace-only changes.

pymoo/algorithms/mocs.py

Lines changed: 0 additions & 95 deletions
This file was deleted.

pymoo/algorithms/rvea.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ def setup(self, problem, **kwargs):
8888
if not isinstance(self.termination, MaximumGenerationTermination):
8989
raise Exception("Please use the n_gen or n_eval as a termination criterion to execute RVEA!")
9090

91+
return self
92+
9193
def _next(self):
9294
super()._next()
9395

pymoo/algorithms/so_cuckoo_search.py

Lines changed: 0 additions & 174 deletions
This file was deleted.

0 commit comments

Comments
 (0)