11import numpy
22
3- def hypesub (l , A , actDim , bounds , pvec , alpha , k ):
4-
3+ def hypesub_ (l , A , actDim , bounds , pvec , alpha , k ):
54 h = numpy .zeros (l )
65 i = numpy .argsort (A [:, actDim - 1 ])
76 S = A [i ]
@@ -27,12 +26,15 @@ def hypesub(l, A, actDim, bounds, pvec, alpha, k):
2726
2827
2928def hypeIndicatorExact (points , bounds , k ):
30- """
31- points: objectives (to be minimized),
32- bounds: reference point,
33- k: parameter of HypE
34-
35- Example: scores = hypeIndicatorExact([[1., 3.], [3., 1.]], [4., 4.], 1)
29+ """HypE algorithm. Python implementation of the Matlab code available at
30+ https://sop.tik.ee.ethz.ch/download/supplementary/hype/
31+
32+ Args:
33+ points(array): 2D array containing the objective values of the
34+ population
35+ bounds(array): 1D array containing the reference point from which to
36+ compute the hyper-volume
37+ k(int): HypE parameter
3638 """
3739
3840 Ps = points .shape [0 ]
@@ -47,10 +49,23 @@ def hypeIndicatorExact(points, bounds, k):
4749 alpha .append (numpy .prod ((k - j ) / (Ps - j ) / i ))
4850 alpha = numpy .asarray (alpha )
4951
50- return hypesub (points .shape [0 ], points , actDim , bounds , pvec , alpha , k )
52+ return hypesub_ (points .shape [0 ], points , actDim , bounds , pvec , alpha , k )
5153
5254
5355def hypeIndicatorSampled (points , bounds , k , nrOfSamples ):
56+ """Monte-Carlo approximation of the HypE algorithm. Python implementation
57+ of the Matlab code available at
58+ https://sop.tik.ee.ethz.ch/download/supplementary/hype/
59+
60+ Args:
61+ points(array): 2D array containing the objective values of the
62+ population
63+ bounds(array): 1D array containing the reference point from which to
64+ compute the hyper-volume
65+ k(int): HypE parameter
66+ nrOfSamples(int): number of random samples to use for the
67+ Monte-Carlo approximation
68+ """
5469
5570 nrP = points .shape [0 ]
5671 dim = points .shape [1 ]
0 commit comments