Tune.Search.Study (Tune v0.5.0)

Copy Markdown View Source

Shared limits and accounting for Tune runs.

A Study owns limits, accounting, candidate identity, history, the incumbent, local random state, stop state, and result construction. It does not know a search algorithm or a runtime program type.

Summary

Types

t()

@type t() :: %Tune.Search.Study{
  best: term(),
  budget: term(),
  calls: term(),
  candidates: term(),
  evaluations: term(),
  expires_at: term(),
  limits: term(),
  max_model_calls: term(),
  metadata: term(),
  next_id: term(),
  notes: term(),
  rand: term(),
  seed: term(),
  stop_reason: term(),
  successful_models: term(),
  usage: term()
}

Functions

account_evaluation(study, evaluation)

@spec account_evaluation(t(), Tune.Evaluation.t()) :: t()

account_score(study, evaluation)

@spec account_score(t(), Tune.Evaluation.t()) :: t()

emit(study, event)

@spec emit(t(), map()) :: :ok

evaluation_limits(study)

@spec evaluation_limits(t()) :: map()

exhausted?(study)

@spec exhausted?(t()) :: boolean()

incumbent(study)

@spec incumbent(t()) :: Tune.Candidate.t() | nil

limit_reason(study)

@spec limit_reason(t()) :: atom() | nil

new(opts \\ [])

@spec new(keyword()) :: t()

note(study, key, value)

@spec note(t(), atom(), term()) :: t()

notes(study)

@spec notes(t()) :: map()

random(study)

@spec random(t()) :: {float(), t()}

random(study, operation)

@spec random(t(), (term() -> {term(), term()})) :: {term(), t()}

record(study, value, parameters, evaluation, attributes \\ %{})

@spec record(t(), term(), map(), Tune.Evaluation.t() | nil, map()) ::
  {Tune.Candidate.t(), t()}

remaining_deadline(study)

@spec remaining_deadline(t()) :: non_neg_integer() | nil

remaining_evaluations(study)

@spec remaining_evaluations(t()) :: non_neg_integer() | nil

remaining_model_calls(study)

@spec remaining_model_calls(t()) :: non_neg_integer() | nil

result(study, value, parameters, opts \\ [])

@spec result(t(), term(), map(), keyword()) :: Tune.Result.t()

sample(study, list, k)

@spec sample(t(), list(), non_neg_integer()) :: {list(), t()}

shuffle(study, list)

@spec shuffle(t(), list()) :: {list(), t()}

stop(study, reason)

@spec stop(t(), atom()) :: t()

stop_reason(study)

@spec stop_reason(t()) :: atom() | nil

uniform(study, n)

@spec uniform(t(), pos_integer()) :: {non_neg_integer(), t()}