Geometry

This module allows to define search space based on an Euclidean geometrical object. It works the same as Search space, but all dimensions are continuous.

Classic

class Fractal(*args, **kwargs)[source]

Bases: zellij.core.search_space.Searchspace

Fractal is an abstract class used in DBA. This class is used to build a new kind of search space. Fractals are constrained continuous subspaces.

id

Identifier of a fractal.

Type

int

father

Reference to the parent of the current fractal.

Type

Fractal

children

References to all children of the current fractal.

Type

list[Fractal]

score

Heuristic value is computed by an Heuristic.

Type

{float, int}

levelint

Current level of the fractal in the partition tree. See Tree_search.

See also

Loss Function

Defines what a loss function is

Tree_search

Defines how to explore and exploit a fractal partition tree.

Search space

Initial search space used to build fractal.

Hypercube

Inherited Fractal type

Hypersphere

Inherited Fractal type

abstract create_children(self)[source]

Abstract method. It defines the partition function. Determines how children of the current space should be created.

compute_score(idx)[source]
property father
subspace(self, lo_bounds, up_bounds)[source]

Build a sub space according to the actual Searchspace using two vectors containing lower and upper bounds of the subspace. Can change type to Constant if necessary

Parameters
  • lo_bounds (list) – Lower bounds of the subspace. See Variable for more info.

  • up_bounds (boolean, default=False) – Upper bounds of the subspace. See Variable for more info.

Returns

out – Return a subspace of the actual Searchspace.

Return type

Searchspace

Examples

class Hypercube(*args, **kwargs)[source]

Bases: zellij.core.geometry.Fractal

The hypercube is a basic hypervolume used to decompose the Search space. It is also one of the most computationally inefficient in high dimension. The partition complexity of an Hypercube is equal to O(2^d).

See also

LossFunc

Defines what a loss function is

Tree_search

Defines how to explore and exploit a fractal partition tree.

SearchSpace

Initial search space used to build fractal.

Fractal

Parent class. Basic object to define what a fractal is.

Hypersphere

Another hypervolume, with different properties

create_children(self)[source]

Partition function.

class Hypersphere(*args, **kwargs)[source]

Bases: zellij.core.geometry.Fractal

The Hypersphere is a basic hypervolume used to decompose the Search space. The partition complexity is equal to 2d, but it does fully covers the initial Search space.

dim

Number of dimensions

Type

int

inflation

Inflation rate of hyperspheres. If >0 and <1 it reduces the hypersphere. If >1, it inflates the hypersphere.

Type

float

center

List of floats containing the coordinates of the center of the hypersphere.

Type

list[float]

radius

Radius of the hypersphere.

Type

float

See also

LossFunc

Defines what a loss function is

Tree_search

Defines how to explore and exploit a fractal partition tree.

SearchSpace

Initial search space used to build fractal.

Fractal

Parent class. Basic object to define what a fractal is.

Hypercube

Another hypervolume, with different properties

create_children(self)[source]

Partition function

subspace(self, lo_bounds, up_bounds)[source]

Build a sub space according to the actual Searchspace using two vectors containing lower and upper bounds of the subspace. Can change type to Constant if necessary

Parameters
  • lo_bounds (list) – Lower bounds of the subspace. See Variable for more info.

  • up_bounds (boolean, default=False) – Upper bounds of the subspace. See Variable for more info.

Returns

out – Return a subspace of the actual Searchspace.

Return type

Searchspace

Examples

class Section(*args, **kwargs)[source]

Bases: zellij.core.geometry.Fractal

Performs a n-Section of the search space.

section

Defines in how many equal sections the space should be decompose.

Type

int

See also

LossFunc

Defines what a loss function is

Tree_search

Defines how to explore and exploit a fractal partition tree.

SearchSpace

Initial search space used to build fractal.

Fractal

Parent class. Basic object to define what a fractal is.

Hypercube

Another hypervolume, with different properties

create_children()[source]

Partition function.

Voronoï based

class Voronoi(*args, **kwargs)[source]

Bases: zellij.core.geometry.Fractal

DEPRECATED. Must be updated with the new Search space.

abstract create_children(self)[source]

Abstract method. It defines the partition function. Determines how children of the current space should be created.

abstract update()[source]
randomSpoke(s)[source]
dimSpoke(s, dim, r=1)[source]
shiftBorder(s, p)[source]
clipBorder(line, upma, loma)[source]
class DynamicVoronoi(*args, **kwargs)[source]

Bases: zellij.core.geometry.Voronoi

DEPRECATED. Must be updated with the new Search space.

create_children(self)[source]

Abstract method. It defines the partition function. Determines how children of the current space should be created.

update()[source]
class FixedVoronoi(*args, **kwargs)[source]

Bases: zellij.core.geometry.Voronoi

DEPRECATED. Must be updated with the new Search space.

create_children(self)[source]

Abstract method. It defines the partition function. Determines how children of the current space should be created.

update()[source]
class LightFixedVoronoi(*args, **kwargs)[source]

Bases: zellij.core.geometry.Voronoi

DEPRECATED. Must be updated with the new Search space.

create_children(self)[source]

Abstract method. It defines the partition function. Determines how children of the current space should be created.

update()[source]
class BoxedVoronoi(*args, **kwargs)[source]

Bases: zellij.core.geometry.Voronoi

DEPRECATED. Must be updated with the new Search space.

create_children(self)[source]

Abstract method. It defines the partition function. Determines how children of the current space should be created.

update()[source]

Miscellaneous

class Direct(*args, **kwargs)[source]

Bases: zellij.core.geometry.Fractal

DIRECT geometry.

sigma

Sigma function. Determines a measurement of the size of a subspace.

Type

Direct_size

longest

Index of the dimensions with the longest side of the space.

Type

list[int]

width

Value of the longest side of the space.

Type

float

center

Center of the space.

Type

list[float]

See also

LossFunc

Defines what a loss function is

Tree_search

Defines how to explore and exploit a fractal partition tree.

SearchSpace

Initial search space used to build fractal.

Fractal

Parent class. Basic object to define what a fractal is.

Hypercube

Another hypervolume, with different properties

create_children()[source]

Partition function

class Soo(*args, **kwargs)[source]

Bases: zellij.core.geometry.Fractal

Performs a n-Section of the search space.

dim

Number of dimensions

Type

int

See also

LossFunc

Defines what a loss function is

Tree_search

Defines how to explore and exploit a fractal partition tree.

SearchSpace

Initial search space used to build fractal.

Fractal

Parent class. Basic object to define what a fractal is.

Hypercube

Another hypervolume, with different properties

create_children(self)[source]

Abstract method. It defines the partition function. Determines how children of the current space should be created.