Packages

Production-ready hyperparameter optimization for Elixir with high Optuna parity. Leverages BEAM fault tolerance, real-time dashboards, and native distributed computing.

Current section

Files

Jump to
scout lib util seed.ex
Raw

lib/util/seed.ex

defmodule Scout.Util.Seed do
@moduledoc "Deterministic per-study/per-trial RNG seeding."
@doc "Returns a per-trial triad seed from {study_id, trial_ix, base_seed}"
def seed_for(study_id, ix, base_seed) do
<<a::32, b::32, c::32>> =
:crypto.hash(:sha256, "#{study_id}:#{ix}:#{base_seed}")
|> binary_part(0, 12)
{:exsss, {a, b, c}}
end
end