callback

package
v0.26.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ModeTrain   Mode   = "train"
	ModeVal     Mode   = "val"
	ModeTest    Mode   = "test"
	EventStart  Event  = "start"
	EventDuring Event  = "during"
	EventEnd    Event  = "end"
	EventSave   Event  = "save"
	ActionNop   Action = "nop"
	ActionSave  Action = "save"
	ActionHalt  Action = "halt"
)
View Source
var (
	LoggerVerbose      = "verbose"
	LoggerTotalBatches = "totalBatches"
	LoggerPrefetched   = "prefetched"
)

Functions

This section is empty.

Types

type Action

type Action string

type Callback

type Callback interface {
	Init() error
	Call(event Event, mode Mode, epoch int, batch int, logs []Log) ([]Action, error)
}

type Checkpoint

type Checkpoint struct {
	OnEvent    Event
	OnMode     Mode
	Loss       bool
	MetricName string
	Compare    CheckpointCompare
	SaveDir    string
	// contains filtered or unexported fields
}

func (*Checkpoint) Call

func (c *Checkpoint) Call(event Event, mode Mode, epoch int, batch int, logs []Log) ([]Action, error)

func (*Checkpoint) GetSaveDir

func (c *Checkpoint) GetSaveDir() string

func (*Checkpoint) Init

func (c *Checkpoint) Init() error

type CheckpointCompare

type CheckpointCompare string
var (
	CheckpointCompareMin CheckpointCompare = "min"
	CheckpointCompareMax CheckpointCompare = "max"
)

type EarlyStoppingOnMetric added in v0.26.28

type EarlyStoppingOnMetric struct {
	OnEvent    Event
	OnMode     Mode
	MetricName string
	Mode       EarlyStoppingOnMetricMode
	MaxValue   float64
	MinValue   float64
}

func (*EarlyStoppingOnMetric) Call added in v0.26.28

func (c *EarlyStoppingOnMetric) Call(event Event, mode Mode, epoch int, batch int, logs []Log) ([]Action, error)

func (*EarlyStoppingOnMetric) Init added in v0.26.28

func (c *EarlyStoppingOnMetric) Init() error

type EarlyStoppingOnMetricMode added in v0.26.28

type EarlyStoppingOnMetricMode string
var (
	Min EarlyStoppingOnMetricMode = "min"
	Max EarlyStoppingOnMetricMode = "max"
)

type Event

type Event string

type HasSaveDir

type HasSaveDir interface {
	GetSaveDir() string
}

type Log

type Log struct {
	Name      string
	Value     float64
	Precision int
}

type Logger

type Logger struct {
	FileLogger     *cblog.Logger
	Progress       bool
	ProgressLogDir string
	// contains filtered or unexported fields
}

func (*Logger) Call

func (l *Logger) Call(event Event, mode Mode, epoch int, batch int, logs []Log) ([]Action, error)

func (*Logger) Init

func (l *Logger) Init() error

type Mode

type Mode string

type RecordStats

type RecordStats struct {
	RecordDir      string
	RecordFileName string
	OnEvent        Event
	OnMode         Mode
	// contains filtered or unexported fields
}

func (*RecordStats) Call

func (r *RecordStats) Call(event Event, mode Mode, epoch int, batch int, logs []Log) ([]Action, error)

func (*RecordStats) Init

func (r *RecordStats) Init() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL