Tune.Search.ProgramStrategy behaviour (Tune v0.5.0)

Copy Markdown View Source

An internal program-search algorithm.

An optimizer validates its own configuration, declares which datasets, model roles, and limits it needs, and compiles a new program from a normalized Tune.Search.Program.Context. It changes task parameters only. Model configurations, the adapter, and dataset roles are fixed by the context for the whole run.

Summary

Callbacks

Builds a new program. Returns the program and the final context, or an error and the final context. The context carries candidates, accounting, and the stop reason used for the report.

Validates and normalizes optimizer configuration.

Declares the datasets, roles, and limits the configured algorithm needs.

Types

requirements()

@type requirements() :: %{
  :datasets => [:train | :validation],
  :roles => [:teacher | :proposal],
  :model_calls? => boolean(),
  optional(:metric?) => boolean()
}

Callbacks

compile(config, t, t)

Builds a new program. Returns the program and the final context, or an error and the final context. The context carries candidates, accounting, and the stop reason used for the report.

init(keyword)

@callback init(keyword()) :: {:ok, term()} | {:error, Exception.t()}

Validates and normalizes optimizer configuration.

requirements(config)

@callback requirements(config :: term()) :: requirements()

Declares the datasets, roles, and limits the configured algorithm needs.