Skip to content

Commit 42d586c

Browse files
Update optimizer.py
1 parent d71e2b1 commit 42d586c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pypop7/optimizers/core/optimizer.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@
55

66

77
class Terminations(IntEnum):
8-
"""Helper class used by all optimizer classes."""
8+
"""Helper class used by all black-box optimizers.
9+
10+
Four different termination conditions are considered for all optimizers, as below:
11+
* MAX_FUNCTION_EVALUATIONS
12+
* MAX_RUNTIME
13+
* FITNESS_THRESHOLD
14+
* EARLY_STOPPING
15+
"""
916
NO_TERMINATION = 0
1017
MAX_FUNCTION_EVALUATIONS = 1 # maximum of function evaluations
1118
MAX_RUNTIME = 2 # maximal runtime to be allowed
12-
FITNESS_THRESHOLD = 3 # when the best-so-far fitness is below fitness threshold, the optimizer will stop
13-
EARLY_STOPPING = 4 # when the best-so-far fitness does not improve for a long time, the optimizer will stop
19+
FITNESS_THRESHOLD = 3 # when best-so-far fitness is below threshold
20+
EARLY_STOPPING = 4 # when best-so-far fitness does not improve for a long time
1421

1522

1623
class Optimizer(object):

0 commit comments

Comments
 (0)