# ribs.emitters.IsoLineEmitter¶

class ribs.emitters.IsoLineEmitter(archive, x0, iso_sigma=0.01, line_sigma=0.2, bounds=None, batch_size=64, seed=None)[source]

Emits solutions that are nudged towards other archive solutions.

If the archive is empty, calls to ask() will generate solutions from an isotropic Gaussian distribution with mean x0 and standard deviation iso_sigma. Otherwise, to generate each new solution, the emitter selects a pair of elites $$x_i$$ and $$x_j$$ and samples from

$x_i + \sigma_{iso} \mathcal{N}(0,\mathcal{I}) + \sigma_{line}(x_j - x_i)\mathcal{N}(0,1)$

This emitter is based on the Iso+LineDD operator presented in Vassiliades 2018.

Parameters
• archive (ribs.archives.ArchiveBase) – An archive to use when creating and inserting solutions. For instance, this can be ribs.archives.GridArchive.

• x0 (array-like) – Center of the Gaussian distribution from which to sample solutions when the archive is empty.

• iso_sigma (float) – Scale factor for the isotropic distribution used when generating solutions.

• line_sigma (float) – Scale factor for the line distribution used when generating solutions.

• bounds (None or array-like) – Bounds of the solution space. Solutions are clipped to these bounds. Pass None to indicate there are no bounds. Alternatively, pass an array-like to specify the bounds for each dim. Each element in this array-like can be None to indicate no bound, or a tuple of (lower_bound, upper_bound), where lower_bound or upper_bound may be None to indicate no bound.

• batch_size (int) – Number of solutions to return in ask().

• seed (int) – Value to seed the random number generator. Set to None to avoid a fixed seed.

Methods

 Generates batch_size solutions. tell(solutions, objective_values, …[, …]) Inserts entries into the archive.

Attributes

 archive The archive which stores solutions generated by this emitter. batch_size Number of solutions to return in ask(). iso_sigma Scale factor for the isotropic distribution used when generating solutions. line_sigma Scale factor for the line distribution used when generating solutions. lower_bounds (solution_dim,) array with lower bounds of solution space. solution_dim The dimension of solutions produced by this emitter. upper_bounds (solution_dim,) array with upper bounds of solution space. x0 Center of the Gaussian distribution from which to sample solutions when the archive is empty.
ask()[source]

Generates batch_size solutions.

If the archive is empty, solutions are drawn from an isotropic Gaussian distribution centered at self.x0 with standard deviation self.iso_sigma. Otherwise, each solution is drawn as described in this class’s docstring.

Returns

(batch_size, solution_dim) array – contains batch_size new solutions to evaluate.

tell(solutions, objective_values, behavior_values, metadata=None)

Inserts entries into the archive.

This base class implementation (in EmitterBase) simply inserts entries into the archive by calling add(). It is enough for simple emitters like GaussianEmitter, but more complex emitters will almost certainly need to override it.

Parameters
• solutions (numpy.ndarray) – Array of solutions generated by this emitter’s ask() method.

• objective_values (numpy.ndarray) – 1D array containing the objective function value of each solution.

• behavior_values (numpy.ndarray) – (n, <behavior space dimension>) array with the behavior space coordinates of each solution.

• metadata (numpy.ndarray) – 1D object array containing a metadata object for each solution.

property archive

The archive which stores solutions generated by this emitter.

Type

ribs.archives.ArchiveBase

property batch_size

Number of solutions to return in ask().

Type

int

property iso_sigma

Scale factor for the isotropic distribution used when generating solutions.

Type

float

property line_sigma

Scale factor for the line distribution used when generating solutions.

Type

float

property lower_bounds

(solution_dim,) array with lower bounds of solution space.

For instance, [-1, -1, -1] indicates that every dimension of the solution space has a lower bound of -1.

Type

numpy.ndarray

property solution_dim

The dimension of solutions produced by this emitter.

Type

int

property upper_bounds

(solution_dim,) array with upper bounds of solution space.

For instance, [1, 1, 1] indicates that every dimension of the solution space has an upper bound of 1.

Type

numpy.ndarray

property x0

Center of the Gaussian distribution from which to sample solutions when the archive is empty.

Type

numpy.ndarray