metaheuristic_designer.strategies.EDA.PBIL module#

Population-Based Incremental Learning (PBIL) strategies.

class BernoulliPBIL(initializer, parent_sel=None, survivor_sel=None, name='BernoulliPBIL', offspring_size=None, rng=None, p=None, lr=0.001, noise=0, **kwargs)[source]#

Bases: EDAStrategy

PBIL for binary vectors using a Bernoulli distribution.

The probability vector p is updated each generation with a learning rate and optional Gaussian noise, then a new population is sampled.

Reference: https://doi.org/10.1016/j.swevo.2011.08.003

Parameters:
initializerInitializer

Population initializer.

parent_selParentSelection, optional

Parent selection method.

survivor_selSurvivorSelection, optional

Survivor selection method.

namestr, optional

Display name (default "BernoulliPBIL").

offspring_sizeint or SchedulableParameter, optional

Number of offspring per generation.

rngRNGLike, optional

Random number generator.

parray-like, optional

Initial probability vector. Defaults to uniform over [0,1].

lrfloat, optional

Learning rate for updating p (default 1e-3).

noisefloat, optional

Standard deviation of Gaussian noise added to p (default 0).

**kwargs

Forwarded to EDAStrategy.

Attributes:
params

Access parameter values by attribute-style lookup.

population_size

Gets the amount of individuals in the population.

Parameters:

Methods

estimate_parameters(population)

Utilizes the samples present in the input population to estimate the parameters used by the operator.

extra_report()

Hook called at the end of the optimization (intended for subclasses).

extra_step_info()

Hook called after each generation (intended for subclasses).

gather_parameters()

Collect the current parameters from all sub-components.

get_params()

Return a copy of the current parameter dictionary.

get_state()

Gets the current state of the search strategy as a dictionary.

initialize(objfunc)

Initializes the optimization search strategy.

step(prev_population, objfunc)

Performs a single iteration of the algorithm on a given population.

store_kwargs([progress])

Store keyword arguments and evaluate them at the given progress.

update(progress)

Advances the state of the search by one iteration.

update_kwargs([progress])

Add or replace parameters and immediately evaluate them.

reset

estimate_parameters(population)[source]#

Utilizes the samples present in the input population to estimate the parameters used by the operator.

Parameters:
populationPopulation

Data to use for estimating parameters.

Returns:
Operator

Newly configured operator.

class BinomialPBIL(initializer, parent_sel=None, survivor_sel=None, name='BernoulliPBIL', offspring_size=None, rng=None, p=0.5, n=None, lr=0.001, noise=0, **kwargs)[source]#

Bases: EDAStrategy

PBIL for discrete vectors using a Binomial distribution.

Reference: https://doi.org/10.1016/j.swevo.2011.08.003

Parameters:
initializerInitializer

Population initializer.

parent_selParentSelection, optional

Parent selection method.

survivor_selSurvivorSelection, optional

Survivor selection method.

namestr, optional

Display name (default "BinomialPBIL").

offspring_sizeint or SchedulableParameter, optional

Number of offspring per generation.

rngRNGLike, optional

Random number generator.

pfloat or array-like, optional

Initial success probability (default 0.5).

nint or array-like

Number of trials. Must be provided; there is no default.

lrfloat, optional

Learning rate (default 1e-3).

noisefloat, optional

Gaussian noise standard deviation (default 0).

**kwargs

Forwarded to EDAStrategy.

Attributes:
params

Access parameter values by attribute-style lookup.

population_size

Gets the amount of individuals in the population.

Parameters:

Methods

estimate_parameters(population)

Utilizes the samples present in the input population to estimate the parameters used by the operator.

extra_report()

Hook called at the end of the optimization (intended for subclasses).

extra_step_info()

Hook called after each generation (intended for subclasses).

gather_parameters()

Collect the current parameters from all sub-components.

get_params()

Return a copy of the current parameter dictionary.

get_state()

Gets the current state of the search strategy as a dictionary.

initialize(objfunc)

Initializes the optimization search strategy.

step(prev_population, objfunc)

Performs a single iteration of the algorithm on a given population.

store_kwargs([progress])

Store keyword arguments and evaluate them at the given progress.

update(progress)

Advances the state of the search by one iteration.

update_kwargs([progress])

Add or replace parameters and immediately evaluate them.

reset

estimate_parameters(population)[source]#

Utilizes the samples present in the input population to estimate the parameters used by the operator.

Return type:

Operator

Parameters:
populationPopulation

Data to use for estimating parameters.

Returns:
Operator

Newly configured operator.

Parameters:

population (Population)

class GaussianPBIL(initializer, parent_sel=None, survivor_sel=None, name='GaussianPBIL', offspring_size=None, rng=None, loc=None, scale=1, lr=0.001, noise=0, **kwargs)[source]#

Bases: EDAStrategy

PBIL for continuous vectors using a Gaussian distribution.

The location vector loc is updated each generation with a learning rate and optional Gaussian noise, then a new population is sampled.

Reference: https://doi.org/10.1016/j.swevo.2011.08.003

Parameters:
initializerInitializer

Population initializer.

parent_selParentSelection, optional

Parent selection method.

survivor_selSurvivorSelection, optional

Survivor selection method.

namestr, optional

Display name (default "GaussianPBIL").

offspring_sizeint or SchedulableParameter, optional

Number of offspring per generation.

rngRNGLike, optional

Random number generator.

locarray-like, optional

Initial mean vector (default None; the operator uses a fallback).

scalefloat or array-like, optional

Standard deviation (default 1).

lrfloat, optional

Learning rate (default 1e-3).

noisefloat, optional

Gaussian noise standard deviation added to loc (default 0).

**kwargs

Forwarded to EDAStrategy.

Attributes:
params

Access parameter values by attribute-style lookup.

population_size

Gets the amount of individuals in the population.

Parameters:

Methods

estimate_parameters(population)

Utilizes the samples present in the input population to estimate the parameters used by the operator.

extra_report()

Hook called at the end of the optimization (intended for subclasses).

extra_step_info()

Hook called after each generation (intended for subclasses).

gather_parameters()

Collect the current parameters from all sub-components.

get_params()

Return a copy of the current parameter dictionary.

get_state()

Gets the current state of the search strategy as a dictionary.

initialize(objfunc)

Initializes the optimization search strategy.

step(prev_population, objfunc)

Performs a single iteration of the algorithm on a given population.

store_kwargs([progress])

Store keyword arguments and evaluate them at the given progress.

update(progress)

Advances the state of the search by one iteration.

update_kwargs([progress])

Add or replace parameters and immediately evaluate them.

reset

estimate_parameters(population)[source]#

Utilizes the samples present in the input population to estimate the parameters used by the operator.

Parameters:
populationPopulation

Data to use for estimating parameters.

Returns:
Operator

Newly configured operator.