Documentation ¶
Index ¶
- Constants
- func CreateHeartbeat(repo repository.Repository, experimentID string, t time.Time) error
- func DeleteHeartbeat(repo repository.Repository, experimentID string) error
- type Checkpoint
- type CheckpointOrExperiment
- type CreateCheckpointArgs
- type CreateExperimentArgs
- type Experiment
- func (e *Experiment) BestCheckpoint() *Checkpoint
- func (e *Experiment) HeartbeatPath() string
- func (e *Experiment) LatestCheckpoint() *Checkpoint
- func (e *Experiment) MetadataPath() string
- func (e *Experiment) Save(repo repository.Repository) error
- func (e *Experiment) ShortID() string
- func (c *Experiment) SortedParams() []*NamedParam
- func (e *Experiment) StorageTarPath() string
- type Heartbeat
- type MetricGoal
- type NamedParam
- type PrimaryMetric
- type Project
- func (p *Project) CheckoutCheckpoint(checkpoint *Checkpoint, experiment *Experiment, outputDir string, quiet bool) error
- func (p *Project) CheckoutFileOrDirectory(checkpoint *Checkpoint, experiment *Experiment, outputDir string, ...) error
- func (p *Project) CheckpointFromPrefix(prefix string) (*Checkpoint, *Experiment, error)
- func (p *Project) CheckpointOrExperimentFromPrefix(prefix string) (*CheckpointOrExperiment, error)
- func (p *Project) CreateCheckpoint(args CreateCheckpointArgs, async bool, workChan chan func() error, quiet bool) (*Checkpoint, error)
- func (p *Project) CreateExperiment(args CreateExperimentArgs, async bool, workChan chan func() error, quiet bool) (*Experiment, error)
- func (p *Project) DeleteCheckpoint(chk *Checkpoint) error
- func (p *Project) DeleteExperiment(exp *Experiment) error
- func (p *Project) ExperimentByID(id string) (*Experiment, error)
- func (p *Project) ExperimentFromPrefix(prefix string) (*Experiment, error)
- func (p *Project) ExperimentIsRunning(experimentID string) (bool, error)
- func (p *Project) Experiments() ([]*Experiment, error)
- func (p *Project) RefreshHeartbeat(experimentID string) error
- func (p *Project) SaveExperiment(exp *Experiment, quiet bool) (*Experiment, error)
- func (p *Project) StopExperiment(experimentID string) error
Constants ¶
const IDLength = 64
Variables ¶
This section is empty.
Functions ¶
func CreateHeartbeat ¶
func CreateHeartbeat(repo repository.Repository, experimentID string, t time.Time) error
func DeleteHeartbeat ¶
func DeleteHeartbeat(repo repository.Repository, experimentID string) error
Types ¶
type Checkpoint ¶
type Checkpoint struct { ID string `json:"id"` Created time.Time `json:"created"` Metrics param.ValueMap `json:"metrics"` Step int64 `json:"step"` Path string `json:"path"` PrimaryMetric *PrimaryMetric `json:"primary_metric"` }
Checkpoint is a snapshot of an experiment's filesystem
func NewCheckpoint ¶
func NewCheckpoint(metrics param.ValueMap) *Checkpoint
NewCheckpoint creates a checkpoint with default values
func (*Checkpoint) ShortID ¶
func (c *Checkpoint) ShortID() string
func (*Checkpoint) SortedMetrics ¶
func (c *Checkpoint) SortedMetrics() []*NamedParam
func (*Checkpoint) StorageTarPath ¶
func (c *Checkpoint) StorageTarPath() string
type CheckpointOrExperiment ¶
type CheckpointOrExperiment struct { Checkpoint *Checkpoint Experiment *Experiment }
type CreateCheckpointArgs ¶
type CreateExperimentArgs ¶
type Experiment ¶
type Experiment struct { ID string `json:"id"` Created time.Time `json:"created"` Params param.ValueMap `json:"params"` Host string `json:"host"` User string `json:"user"` Config *config.Config `json:"config"` Command string `json:"command"` Path string `json:"path"` PythonVersion string `json:"python_version"` PythonPackages map[string]string `json:"python_packages"` Checkpoints []*Checkpoint `json:"checkpoints"` KeepsakeVersion string `json:"keepsake_version"` ReplicateVersion string `json:"replicate_version,omitempty"` }
Experiment represents a training run
func NewExperiment ¶
func NewExperiment(params param.ValueMap) *Experiment
NewExperiment creates an experiment, setting ID and Created
func (*Experiment) BestCheckpoint ¶
func (e *Experiment) BestCheckpoint() *Checkpoint
BestCheckpoint returns the best checkpoint for an experiment according to the primary metric, or nil if primary metric is not defined or if none of the checkpoints have the primary metric defined
func (*Experiment) HeartbeatPath ¶
func (e *Experiment) HeartbeatPath() string
func (*Experiment) LatestCheckpoint ¶
func (e *Experiment) LatestCheckpoint() *Checkpoint
LatestCheckpoint returns the latest checkpoint for an experiment
func (*Experiment) MetadataPath ¶
func (e *Experiment) MetadataPath() string
func (*Experiment) Save ¶
func (e *Experiment) Save(repo repository.Repository) error
Save experiment to repository
func (*Experiment) ShortID ¶
func (e *Experiment) ShortID() string
func (*Experiment) SortedParams ¶
func (c *Experiment) SortedParams() []*NamedParam
func (*Experiment) StorageTarPath ¶
func (e *Experiment) StorageTarPath() string
type Heartbeat ¶
type MetricGoal ¶
type MetricGoal string
const ( GoalMaximize MetricGoal = "maximize" GoalMinimize MetricGoal = "minimize" )
type NamedParam ¶
type PrimaryMetric ¶
type PrimaryMetric struct { Name string `json:"name"` Goal MetricGoal `json:"goal"` }
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
Project is essentially a data access object for retrieving metadata objects
func NewProject ¶
func NewProject(repo repository.Repository, directory string) *Project
func (*Project) CheckoutCheckpoint ¶
func (p *Project) CheckoutCheckpoint(checkpoint *Checkpoint, experiment *Experiment, outputDir string, quiet bool) error
func (*Project) CheckoutFileOrDirectory ¶
func (p *Project) CheckoutFileOrDirectory(checkpoint *Checkpoint, experiment *Experiment, outputDir string, checkoutPath string) error
checkout all the files from an experiment or checkpoint
func (*Project) CheckpointFromPrefix ¶
func (p *Project) CheckpointFromPrefix(prefix string) (*Checkpoint, *Experiment, error)
CheckpointFromPrefix returns an experiment that matches a given ID prefix.
func (*Project) CheckpointOrExperimentFromPrefix ¶
func (p *Project) CheckpointOrExperimentFromPrefix(prefix string) (*CheckpointOrExperiment, error)
CheckpointOrExperimentFromPrefix returns a checkpoint/experiment given a prefix. This is a single function so we can detect ambiguities across both checkpoints and experiments.
func (*Project) CreateCheckpoint ¶
func (p *Project) CreateCheckpoint(args CreateCheckpointArgs, async bool, workChan chan func() error, quiet bool) (*Checkpoint, error)
func (*Project) CreateExperiment ¶
func (p *Project) CreateExperiment(args CreateExperimentArgs, async bool, workChan chan func() error, quiet bool) (*Experiment, error)
func (*Project) DeleteCheckpoint ¶
func (p *Project) DeleteCheckpoint(chk *Checkpoint) error
func (*Project) DeleteExperiment ¶
func (p *Project) DeleteExperiment(exp *Experiment) error
func (*Project) ExperimentByID ¶
func (p *Project) ExperimentByID(id string) (*Experiment, error)
ExperimentByID returns an experiment that matches a given ID.
func (*Project) ExperimentFromPrefix ¶
func (p *Project) ExperimentFromPrefix(prefix string) (*Experiment, error)
ExperimentFromPrefix returns an experiment that matches a given ID prefix.
func (*Project) ExperimentIsRunning ¶
ExperimentIsRunning returns true if an experiment is still running (i.e. the heartbeat has beat in the last n seconds).
func (*Project) Experiments ¶
func (p *Project) Experiments() ([]*Experiment, error)
Experiments returns all experiments in this project
func (*Project) RefreshHeartbeat ¶
func (*Project) SaveExperiment ¶
func (p *Project) SaveExperiment(exp *Experiment, quiet bool) (*Experiment, error)