evorl.ec.optimizers.vanilla_ga

Module Contents

Classes

VanillaGA

Vanilla Genetic Algorithm.

VanillaGAState

State of the VanillaGA.

API

class evorl.ec.optimizers.vanilla_ga.VanillaGA[source]

Bases: evorl.ec.optimizers.ec_optimizer.EvoOptimizer

Vanilla Genetic Algorithm.

The Genetic Algorithm used in the original ERL. Paper: Evolution-Guided Policy Gradient in Reinforcement Learning

ask(state: evorl.ec.optimizers.vanilla_ga.VanillaGAState) tuple[chex.ArrayTree, evorl.ec.optimizers.vanilla_ga.VanillaGAState][source]
enable_crossover: bool

True

init(pop: chex.ArrayTree, key: chex.PRNGKey) evorl.ec.optimizers.vanilla_ga.VanillaGAState[source]
matrix_num_mutation_frac: float

0.01

mut_strength: float

0.1

num_crossover_frac: float

0.1

num_elites: int

None

pop_size: int

None

tell(state: evorl.ec.optimizers.vanilla_ga.VanillaGAState, fitnesses: chex.Array) tuple[evorl.types.PyTreeDict, evorl.ec.optimizers.vanilla_ga.VanillaGAState][source]
tournament_size: int

2

vector_num_mutation_frac: float

0.0

weight_max_magnitude: float

1000000.0

class evorl.ec.optimizers.vanilla_ga.VanillaGAState[source]

Bases: evorl.types.PyTreeData

State of the VanillaGA.

key: chex.PRNGKey

None

pop: chex.ArrayTree

None