Documentation
¶
Index ¶
- Constants
- type API
- type Assignment
- type Bounds
- type Error
- type ErrorType
- type Experiment
- type ExperimentItem
- type ExperimentList
- type ExperimentListMeta
- type ExperimentListQuery
- type ExperimentMeta
- type ExperimentName
- type Meta
- type Metadata
- type Metric
- type Optimization
- type Parameter
- type ParameterType
- type TrialAssignments
- type TrialItem
- type TrialList
- type TrialListQuery
- type TrialMeta
- type TrialStatus
- type TrialValues
- type Value
Constants ¶
View Source
const ( ErrExperimentNameInvalid ErrorType = "experiment-name-invalid" ErrExperimentNameConflict = "experiment-name-conflict" ErrExperimentInvalid = "experiment-invalid" ErrExperimentNotFound = "experiment-not-found" ErrExperimentStopped = "experiment-stopped" ErrTrialInvalid = "trial-invalid" ErrTrialNotFound = "trial-not-found" ErrUnexpected = "unexpected" )
View Source
const ( TrialStaged TrialStatus = "staged" TrialActive = "active" TrialCompleted = "completed" TrialFailed = "failed" TrialAbandoned = "abandoned" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
GetAllExperiments(context.Context, *ExperimentListQuery) (ExperimentList, error)
GetAllExperimentsByPage(context.Context, string) (ExperimentList, error)
GetExperimentByName(context.Context, ExperimentName) (Experiment, error)
GetExperiment(context.Context, string) (Experiment, error)
CreateExperiment(context.Context, ExperimentName, Experiment) (Experiment, error)
DeleteExperiment(context.Context, string) error
GetAllTrials(context.Context, string, *TrialListQuery) (TrialList, error)
CreateTrial(context.Context, string, TrialAssignments) (string, error) // TODO Should this return TrialAssignments?
NextTrial(context.Context, string) (TrialAssignments, error)
ReportTrial(context.Context, string, TrialValues) error
AbandonRunningTrial(context.Context, string) error
}
API provides bindings for the supported endpoints
type Assignment ¶
type Error ¶
type Error struct {
Type ErrorType `json:"-"`
Message string `json:"error"`
RetryAfter time.Duration `json:"-"`
}
Error represents the API specific error messages and may be used in response to HTTP status codes
type Experiment ¶
type Experiment struct {
ExperimentMeta
// The display name of the experiment. Do not use for generating URLs!
DisplayName string `json:"displayName,omitempty"`
// Controls how the optimizer will generate trials.
Optimization Optimization `json:"optimization,omitempty"`
// The metrics been optimized in the experiment.
Metrics []Metric `json:"metrics"`
// The search space of the experiment.
Parameters []Parameter `json:"parameters"`
}
Experiment combines the search space, outcomes and optimization configuration
type ExperimentItem ¶
type ExperimentItem struct {
Experiment
// The metadata for an individual experiment.
Metadata Metadata `json:"_metadata,omitempty"`
}
type ExperimentList ¶
type ExperimentList struct {
ExperimentListMeta
// The list of experiments.
Experiments []ExperimentItem `json:"experiments,omitempty"`
}
type ExperimentListMeta ¶
func (*ExperimentListMeta) SetLastModified ¶
func (m *ExperimentListMeta) SetLastModified(time.Time)
func (*ExperimentListMeta) SetLink ¶
func (m *ExperimentListMeta) SetLink(rel, link string)
func (*ExperimentListMeta) SetLocation ¶
func (m *ExperimentListMeta) SetLocation(string)
type ExperimentListQuery ¶
func (*ExperimentListQuery) Encode ¶
func (p *ExperimentListQuery) Encode() string
type ExperimentMeta ¶
type ExperimentMeta struct {
LastModified time.Time `json:"-"`
Self string `json:"-"`
Trials string `json:"-"`
NextTrial string `json:"-"`
}
func (*ExperimentMeta) SetLastModified ¶
func (m *ExperimentMeta) SetLastModified(lastModified time.Time)
func (*ExperimentMeta) SetLink ¶
func (m *ExperimentMeta) SetLink(rel, link string)
func (*ExperimentMeta) SetLocation ¶
func (m *ExperimentMeta) SetLocation(string)
type ExperimentName ¶
type ExperimentName interface {
Name() string
}
ExperimentName exists to clearly separate cases where an actual name can be used
func NewExperimentName ¶
func NewExperimentName(n string) ExperimentName
NewExperimentName returns an experiment name for a given string
type Metadata ¶ added in v1.1.1
Metadata is used to hold single or multi-value metadata from list responses
func (*Metadata) UnmarshalJSON ¶ added in v1.1.1
type Optimization ¶
type Optimization struct {
// The estimated number of trial runs to perform for an experiment.
ExperimentBudget int32 `json:"experimentBudget,omitempty"`
// The total number of concurrent trial runs supported for an experiment.
ParallelTrials int32 `json:"parallelTrials,omitempty"`
// The total number of random trials used to start an experiment.
BurnIn int32 `json:"burnIn,omitempty"`
}
type Parameter ¶
type Parameter struct {
// The name of the parameter.
Name string `json:"name"`
// The type of the parameter.
Type ParameterType `json:"type"`
// The domain of the parameter.
Bounds Bounds `json:"bounds"`
}
Parameter is a variable that is going to be tuned in an experiment
type ParameterType ¶
type ParameterType string
const ( ParameterTypeInteger ParameterType = "int" ParameterTypeDouble = "double" )
type TrialAssignments ¶
type TrialAssignments struct {
TrialMeta
// The list of parameter names and their assigned values.
Assignments []Assignment `json:"assignments"`
}
type TrialItem ¶
type TrialItem struct {
TrialAssignments
TrialValues
// The current trial status.
Status TrialStatus `json:"status"`
// Ordinal number indicating when during an experiment the trail was generated.
Number int64 `json:"number"`
// Labels for this trial.
Labels map[string]string `json:"labels,omitempty"`
}
type TrialList ¶
type TrialList struct {
// The list of trials.
Trials []TrialItem `json:"trials"`
}
type TrialListQuery ¶ added in v1.2.0
type TrialListQuery struct {
Status []TrialStatus
}
func (*TrialListQuery) Encode ¶ added in v1.2.0
func (p *TrialListQuery) Encode() string
type TrialMeta ¶
type TrialMeta struct {
ReportTrial string `json:"-"`
}
func (*TrialMeta) SetLastModified ¶
func (*TrialMeta) SetLocation ¶
type TrialStatus ¶
type TrialStatus string
type TrialValues ¶
Click to show internal directories.
Click to hide internal directories.