HPO Specifications

class agilerl.models.hpo.MutationProbabilities(*, no_mut: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.4, arch_mut: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.2, new_layer: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.2, params_mut: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.2, act_mut: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.0, rl_hp_mut: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.2)

Mutation probability distribution.

Parameters:
  • no_mut (float) – Probability of no mutation.

  • arch_mut (float) – Probability of architecture mutation.

  • new_layer (float) – Probability of new layer mutation.

  • params_mut (float) – Probability of parameters mutation.

  • act_mut (float) – Probability of activation mutation.

  • rl_hp_mut (float) – Probability of RL hyperparameter mutation.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class agilerl.models.hpo.MutationSpec(*, probabilities: ~agilerl.models.hpo.MutationProbabilities = <factory>, rl_hp_selection: dict[str, ~agilerl.models.hpo.RLHyperparameter] = <factory>, mutation_sd: ~typing.Annotated[float, ~annotated_types.Ge(ge=0.0)] = 0.1, rand_seed: ~typing.Annotated[int, ~annotated_types.Ge(ge=0)] = 42)

Pydantic model for Mutations object.

Parameters:
  • probabilities (MutationProbabilities) – Probability distribution for the mutations.

  • rl_hp_selection (dict[str, RLHyperparameter]) – RL hyperparameters to mutate.

  • mutation_sd (float) – Standard deviation of the mutation.

  • rand_seed (int) – Random seed for repeatability.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class agilerl.models.hpo.TournamentSelectionSpec(*, tournament_size: Annotated[int, Ge(ge=2)] = 2, elitism: bool = True)

Pydantic model for TournamentSelection object.

Parameters:
  • tournament_size (int) – Size of the tournament.

  • elitism (bool) – Whether elitism is enabled.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].