training

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adam

type Adam struct {
	// contains filtered or unexported fields
}

func NewAdam

func NewAdam(lr, beta, beta2, epsilon float64) *Adam

func (*Adam) Init

func (o *Adam) Init(size int)

func (*Adam) Update

func (o *Adam) Update(value, gradient float64, t, idx int) float64

type BatchTrainer

type BatchTrainer struct {
	// contains filtered or unexported fields
}

func NewBatchTrainer

func NewBatchTrainer(solver Solver, verbosity, batchSize, parallelism int) *BatchTrainer

func (*BatchTrainer) Train

func (t *BatchTrainer) Train(n *ml.Neural, examples, validation Examples, iterations int)

type Example

type Example struct {
	Input    []float64
	Response []float64
}

type Examples

type Examples []Example

func (Examples) Shuffle

func (e Examples) Shuffle()

func (Examples) Split

func (e Examples) Split(p float64) (first, second Examples)

func (Examples) SplitN

func (e Examples) SplitN(n int) []Examples

func (Examples) SplitSize

func (e Examples) SplitSize(size int) []Examples

type OnlineTrainer

type OnlineTrainer struct {
	// contains filtered or unexported fields
}

func NewTrainer

func NewTrainer(solver Solver, verbosity int) *OnlineTrainer

func (*OnlineTrainer) Train

func (t *OnlineTrainer) Train(n *ml.Neural, examples, validation Examples, iterations int)

type SGD

type SGD struct {
	// contains filtered or unexported fields
}

func NewSGD

func NewSGD(lr, momentum, decay float64, nesterov bool) *SGD

func (*SGD) Init

func (o *SGD) Init(size int)

func (*SGD) Update

func (o *SGD) Update(value, gradient float64, iteration, idx int) float64

type Solver

type Solver interface {
	Init(size int)
	Update(value, gradient float64, interation, idx int) float64
}

type StatsPrinter

type StatsPrinter struct {
	// contains filtered or unexported fields
}

func NewStatsPrinter

func NewStatsPrinter() *StatsPrinter

func (*StatsPrinter) Init

func (p *StatsPrinter) Init(n *ml.Neural)

func (*StatsPrinter) PrintProgress

func (p *StatsPrinter) PrintProgress(n *ml.Neural, validation Examples, elapsed time.Duration, iteration int)

type Trainer

type Trainer interface {
	Train(n *ml.Neural, examples, validation Examples, iterations int)
}

Jump to

Keyboard shortcuts

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