Documentation ¶
Index ¶
- type Action
- type Create
- type HParamSample
- type PartialUnits
- type SearchMethod
- type SearchMethodType
- type SearchSummary
- type SearchUnit
- type Searcher
- func (s *Searcher) InitialTrials() ([]Action, error)
- func (s *Searcher) Progress() float64
- func (s *Searcher) Record(ops []Action)
- func (s *Searcher) Restore(state json.RawMessage) error
- func (s *Searcher) SetTrialProgress(requestID model.RequestID, progress float64)
- func (s *Searcher) Snapshot() (json.RawMessage, error)
- func (s *Searcher) TrialCreated(requestID model.RequestID) ([]Action, error)
- func (s *Searcher) TrialExited(requestID model.RequestID) ([]Action, error)
- func (s *Searcher) TrialExitedEarly(requestID model.RequestID, exitedReason model.ExitedReason) ([]Action, error)
- func (s *Searcher) TrialIsClosed(requestID model.RequestID) bool
- func (s *Searcher) TrialIsCreated(requestID model.RequestID) bool
- func (s *Searcher) ValidationCompleted(requestID model.RequestID, metrics map[string]interface{}) ([]Action, error)
- type SearcherState
- type Shutdown
- type Stop
- type TrialSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface {
// contains filtered or unexported methods
}
Action is an action that a searcher would like to perform.
type Create ¶
type Create struct { RequestID model.RequestID `json:"request_id"` // TrialSeed must be a value between 0 and 2**31 - 1. TrialSeed uint32 `json:"trial_seed"` Hparams HParamSample `json:"hparams"` }
Create is a directive from the searcher to create a new run.
type HParamSample ¶
type HParamSample map[string]interface{}
HParamSample is a sampling of the hyperparameters for a model.
type PartialUnits ¶
type PartialUnits float64
PartialUnits represent partial epochs, batches or records where the Unit is implied.
type SearchMethod ¶
type SearchMethod interface { // TODO: refactor as model.Snapshotter interface or something model.Snapshotter Type() SearchMethodType // contains filtered or unexported methods }
SearchMethod is the interface for hyperparameter tuning methods. Implementations of this interface should use pointer receivers to ensure interface equality is calculated through pointer equality.
func NewSearchMethod ¶
func NewSearchMethod(c expconf.SearcherConfig) SearchMethod
NewSearchMethod returns a new search method for the provided searcher configuration.
type SearchMethodType ¶
type SearchMethodType string
SearchMethodType is the type of a SearchMethod. It is saved in snapshots to be used when shimming json blobs of searcher snapshots.
const ( // SingleSearch is the SearchMethodType for a single searcher. SingleSearch SearchMethodType = "single" // RandomSearch is the SearchMethodType for a random searcher. RandomSearch SearchMethodType = "random" // GridSearch is the SearchMethodType for a grid searcher. GridSearch SearchMethodType = "grid" // ASHASearch is the SearchMethodType for an ASHA searcher. ASHASearch SearchMethodType = "asha" // AdaptiveASHASearch is the SearchMethodType for an adaptive ASHA searcher. AdaptiveASHASearch SearchMethodType = "adaptive_asha" )
type SearchSummary ¶
type SearchSummary struct { Trials []TrialSummary Config expconf.SearcherConfig }
SearchSummary describes a summary of planned trials and the associated expconf.SearcherConfig.
func Simulate ¶
func Simulate(conf expconf.SearcherConfig, hparams expconf.Hyperparameters) (SearchSummary, error)
Simulate generates the intended training plan for the searcher.
func (SearchSummary) Proto ¶
func (s SearchSummary) Proto() *experimentv1.SearchSummary
Proto converts the SearchSummary to its protobuf representation.
type SearchUnit ¶
SearchUnit is a length unit. If MaxLength is true, Name and Value will be ignored.
func (SearchUnit) Proto ¶
func (su SearchUnit) Proto() *experimentv1.SearchUnit
Proto converts the SearchUnit to its protobuf representation.
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
Searcher encompasses the state as the searcher progresses using the provided search method.
func NewSearcher ¶
func NewSearcher(seed uint32, method SearchMethod, hparams expconf.Hyperparameters) *Searcher
NewSearcher creates a new Searcher configured with the provided searcher config.
func (*Searcher) InitialTrials ¶
InitialTrials returns the initial trials the searcher intends to create at the start of a search. This should be called only once after the searcher has been created.
func (*Searcher) Record ¶
Record records actions that were requested by the searcher for a specific trial.
func (*Searcher) Restore ¶
func (s *Searcher) Restore(state json.RawMessage) error
Restore loads a searcher from prior state.
func (*Searcher) SetTrialProgress ¶
SetTrialProgress informs the searcher of the progress of a given trial.
func (*Searcher) Snapshot ¶
func (s *Searcher) Snapshot() (json.RawMessage, error)
Snapshot returns a searchers current state.
func (*Searcher) TrialCreated ¶
TrialCreated informs the searcher that a new trial has been created.
func (*Searcher) TrialExited ¶
TrialExited informs the searcher that a trial has exited.
func (*Searcher) TrialExitedEarly ¶
func (s *Searcher) TrialExitedEarly( requestID model.RequestID, exitedReason model.ExitedReason, ) ([]Action, error)
TrialExitedEarly informs the searcher that a trial has exited early.
func (*Searcher) TrialIsClosed ¶
TrialIsClosed returns true if the close has been recorded with a TrialExited call.
func (*Searcher) TrialIsCreated ¶
TrialIsCreated returns true if the creation has been recorded with a TrialCreated call.
type SearcherState ¶
type SearcherState struct { TrialsRequested int `json:"trials_requested"` TrialsCreated map[model.RequestID]bool `json:"trials_created"` TrialsClosed map[model.RequestID]bool `json:"trials_closed"` Exits map[model.RequestID]bool `json:"exits"` Cancels map[model.RequestID]bool `json:"cancels"` Failures map[model.RequestID]bool `json:"failures"` TrialProgress map[model.RequestID]float64 `json:"trial_progress"` Rand *nprand.State `json:"rand"` SearchMethodState json.RawMessage `json:"search_method_state"` }
SearcherState encapsulates all persisted searcher state.
type Stop ¶
Stop is a directive from the searcher to stop a run.
type TrialSummary ¶
type TrialSummary struct { Count int Unit SearchUnit }
TrialSummary is a summary of the number of trials that will train for Unit length.
func (TrialSummary) Proto ¶
func (rs TrialSummary) Proto() *experimentv1.TrialSummary
Proto converts the TrialSummary to its protobuf representation.