Evolvable protocol implementation for hyperparameter maps.
Supports schema-driven evolution of mixed-type parameters:
- Floats with linear or log-scale bounds
- Integers with min/max bounds
- Enums (categorical choices)
- Lists of values with length constraints
Schema Format
Bounds can be specified as either ranges (min..max) or tuples ({min, max}).
Note: Ranges only work for integer bounds (Elixir requirement). Use tuples for float bounds.
%{
learning_rate: {:float, {1.0e-5, 1.0e-1}, :log},
hidden_layers: {:list, {:int, 16..256}, length: {1, 3}},
dropout_rate: {:float, {0.0, 0.6}, :linear},
activation: {:enum, [:relu, :tanh, :gelu]},
batch_size: {:enum, [16, 32, 64, 128]}
}Usage
schema = %{learning_rate: {:float, {0.001, 0.1}, :log}}
hparams = Jido.Evolve.Evolvable.HParams.new(schema)
# => %{learning_rate: 0.0032}
Summary
Functions
Creates a new random hyperparameter map from a schema.