Skip to content

Commit 1d8ed98

Browse files
committed
Use American English
1 parent e767267 commit 1d8ed98

4 files changed

Lines changed: 19 additions & 18 deletions

File tree

pygad/benchmarks/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Each problem class can be called with the fitness signature
55
(ga, solution, sol_idx) and returns a fitness in PyGAD's
6-
maximisation format. For problems that are normally written as
6+
maximization format. For problems that are normally written as
77
minimisation, the values are negated.
88
99
Each class also exposes num_genes, num_objectives, and bounds so

pygad/benchmarks/zdt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Two objectives. Variables live in [0, 1] (ZDT4 uses a wider range
55
for some). Every class has a pareto_front() method that returns
6-
points on the true front in PyGAD's maximisation format (negated),
6+
points on the true front in PyGAD's maximization format (negated),
77
which you can pass to the IGD and GD indicators as reference_front.
88
"""
99

pygad/utils/nsga3.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def find_extreme_points(self, fitness, ideal_point, epsilon=ASF_EPSILON):
6666
"""
6767
For each objective axis, find the solution that best represents the
6868
corner of that axis. This is done by running the Achievement
69-
Scalarising Function (ASF) once per axis with a weight vector that
69+
Scalarizing Function (ASF) once per axis with a weight vector that
7070
puts weight 1.0 on the target axis and a tiny weight (epsilon) on
7171
every other axis. The solution with the smallest ASF score wins.
7272
@@ -105,26 +105,26 @@ def compute_intercepts(self, extreme_points, ideal_point, fallback_fitness):
105105
"""
106106
Fit a hyperplane through the M extreme points and return the
107107
intercept point on each axis. The result is the point we use to
108-
scale every objective to the [0, 1] range during normalisation.
108+
scale every objective to the [0, 1] range during normalization.
109109
110110
The NSGA-III paper define the intercept as the point that
111-
normalises to value 1 on its own axis (i.e. each extreme row lands
112-
on a simplex corner after normalisation). The math is:
111+
normalizes to value 1 on its own axis (i.e. each extreme row lands
112+
on a simplex corner after normalization). The math is:
113113
114114
(extreme_points - ideal_point) @ b = 1
115115
intercepts = ideal_point + 1 / b
116116
117117
When the linear system cannot be solved, when any coefficient is
118118
too close to zero, or when the resulting intercept ends up on the
119119
wrong side of the ideal point, fall back to the worst observed
120-
value per objective (the column minimum under maximisation).
120+
value per objective (the column minimum under maximization).
121121
122122
Two extra safety steps run after the linear solve:
123123
1. If an intercept value extrapolates past the worst observed
124124
value for that objective, clip it back to the worst value.
125125
2. If the gap between an intercept and the ideal point shrinks
126126
below INTERCEPT_NEAR_ZERO after clipping, replace that
127-
intercept with the worst observed value so the normalisation
127+
intercept with the worst observed value so the normalization
128128
denominator stays non-zero.
129129
130130
Parameters
@@ -145,7 +145,7 @@ def compute_intercepts(self, extreme_points, ideal_point, fallback_fitness):
145145
ideal_point = numpy.asarray(ideal_point, dtype=float)
146146
extreme_points = numpy.asarray(extreme_points, dtype=float)
147147
fallback_fitness = numpy.asarray(fallback_fitness, dtype=float)
148-
# Worst per objective under maximisation is the column minimum.
148+
# Worst per objective under maximization is the column minimum.
149149
worst_per_objective = fallback_fitness.min(axis=0)
150150
translated = extreme_points - ideal_point
151151
try:
@@ -158,8 +158,8 @@ def compute_intercepts(self, extreme_points, ideal_point, fallback_fitness):
158158
if numpy.any(numpy.abs(coefficients) < INTERCEPT_NEAR_ZERO):
159159
return worst_per_objective
160160
intercepts = ideal_point + 1.0 / coefficients
161-
# Under maximisation a valid intercept sits strictly below the
162-
# ideal. If it does not, the normalisation denominator would flip
161+
# Under maximization a valid intercept sits strictly below the
162+
# ideal. If it does not, the normalization denominator would flip
163163
# sign and produce nonsense values.
164164
if numpy.any(intercepts >= ideal_point - INTERCEPT_NEAR_ZERO):
165165
return worst_per_objective
@@ -188,7 +188,7 @@ def normalise_fitness(self, fitness, ideal_point, intercepts):
188188
Parameters
189189
----------
190190
fitness : numpy.ndarray
191-
The fitness array to normalise.
191+
The fitness array to normalize.
192192
ideal_point : numpy.ndarray
193193
The ideal point.
194194
intercepts : numpy.ndarray
@@ -370,10 +370,10 @@ def nsga3_selection(self, fitness, num_parents):
370370
def _pick_critical_front_survivors(self, accepted_indices, fl_indices,
371371
fitness, K):
372372
"""
373-
Run the NSGA-III normalisation and niching steps on the pool
373+
Run the NSGA-III normalization and niching steps on the pool
374374
P_next U Fl, then ask niching_select for K survivors from Fl.
375375
376-
The ideal point, extreme points, intercepts and normalised values
376+
The ideal point, extreme points, intercepts and normalized values
377377
are all computed on the combined pool (accepted plus critical
378378
front) because that is what the NSGA-III paper specifies.
379379
"""
@@ -590,6 +590,7 @@ def _enumerate_compositions(num_objectives, num_divisions):
590590
if num_objectives == 1:
591591
yield [num_divisions]
592592
return
593+
# 13
593594
for first in range(num_divisions + 1):
594595
for rest in _enumerate_compositions(num_objectives - 1, num_divisions - first):
595596
yield [first] + rest

pygad/utils/quality_indicators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
point to its nearest reference point.
1212
4. spacing: how evenly the approximation points are spread.
1313
14-
All functions take fitness values in PyGAD's maximisation format
14+
All functions take fitness values in PyGAD's maximization format
1515
(higher is better). The reference point for hypervolume must be
1616
worse than every solution on every axis.
1717
"""
@@ -142,7 +142,7 @@ def inverted_generational_distance(fitness, reference_front):
142142
----------
143143
fitness : numpy.ndarray
144144
Approximation front, shape (num_solutions, num_objectives),
145-
in PyGAD's maximisation format.
145+
in PyGAD's maximization format.
146146
reference_front : numpy.ndarray
147147
Reference front, shape (num_reference_points, num_objectives),
148148
in the same format.
@@ -165,7 +165,7 @@ def generational_distance(fitness, reference_front):
165165
----------
166166
fitness : numpy.ndarray
167167
Approximation front, shape (num_solutions, num_objectives),
168-
in PyGAD's maximisation format.
168+
in PyGAD's maximization format.
169169
reference_front : numpy.ndarray
170170
Reference front, shape (num_reference_points, num_objectives),
171171
in the same format.
@@ -190,7 +190,7 @@ def spacing(fitness):
190190
----------
191191
fitness : numpy.ndarray
192192
Approximation front, shape (num_solutions, num_objectives),
193-
in PyGAD's maximisation format.
193+
in PyGAD's maximization format.
194194
195195
Returns
196196
-------

0 commit comments

Comments
 (0)