Jido.Evolve.Mutation.HParams (Jido Evolve v1.0.0)

Copy Markdown View Source

Schema-driven mutation for hyperparameter maps.

Mutates values according to their type in the schema:

  • Floats: Gaussian perturbation (log-space for log-scale)
  • Integers: ±1 step with clamping
  • Enums: Random reselection with low probability
  • Lists: Mutate elements, insert, or delete

Options

  • :schema - Schema definition (required)
  • :rate - Mutation rate per parameter (default: from config)
  • :gaussian_scale - Scale for Gaussian mutations (default: 0.1)

Example

schema = %{
  learning_rate: {:float, 0.001..0.1, :log},
  activation: {:enum, [:relu, :tanh]}
}

hparams = %{learning_rate: 0.01, activation: :relu}
mutate(hparams, config, schema: schema)

Summary

Functions

Default implementation of mutate_with_feedback/3 that ignores feedback.

Default mutation strength that decreases linearly with generation.

Functions

mutate_with_feedback(entity, feedback, opts)

Default implementation of mutate_with_feedback/3 that ignores feedback.

mutation_strength(generation)

Default mutation strength that decreases linearly with generation.