ribs.archives.cqd_score

ribs.archives.cqd_score(archive: ArchiveBase, *, iterations: Int, target_points: ArrayLike, penalties: Int | ArrayLike, obj_min: Float, obj_max: Float, dist_max: Float, dist_ord: Int | Float | 'fro' | 'nuc' = None) CQDScoreResult[source]

Computes the CQD score of an archive.

The Continuous Quality Diversity (CQD) score was introduced in Kent 2022. Please see the CQD Score example for an example of how to call this function on an archive.

Parameters:
archive: ArchiveBase

Archive for which to compute the CQD score. The archive must implement the data() method.

iterations: Int

Number of times to compute the CQD score.

target_points: ArrayLike

(iterations, n, measure_dim) array that lists n target points to use on each iteration.

penalties: Int | ArrayLike

Number of penalty values over which to compute the score (the values are distributed evenly over the range [0,1]). Alternatively, this may be a 1D array that explicitly lists the penalty values. Known as \(\theta\) in Kent 2022.

obj_min: Float

Minimum objective value, used when normalizing the objectives.

obj_max: Float

Maximum objective value, used when normalizing the objectives.

dist_max: Float

Maximum distance between points in measure space.

dist_ord: Int | Float | 'fro' | 'nuc' = None

Order of the norm to use for calculating measure space distance; this is passed to numpy.linalg.norm() as the ord argument. See numpy.linalg.norm() for possible values. The default is to use Euclidean distance (L2 norm).

Returns:

Object containing results of the CQD score calculations.

Raises:

ValueError – target_points or penalties is an array with the wrong shape.