sgd

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	gd.MethodConfig
	LR       mat.Float
	Mu       mat.Float
	Nesterov bool
}

Config provides configuration settings for an SGD optimizer.

func NewConfig

func NewConfig(lr, momentum mat.Float, nesterov bool) Config

NewConfig returns a new SGD Config.

type SGD

type SGD struct {
	Config
	Alpha mat.Float
}

SGD implements the SGD gradient descent optimization method.

func New

func New(c Config) *SGD

New returns a new SGD optimizer, initialized according to the given configuration.

func (*SGD) Delta

func (o *SGD) Delta(param nn.Param) mat.Matrix

Delta returns the difference between the current params and where the method wants it to be.

func (*SGD) Label

func (o *SGD) Label() int

Label returns the enumeration-like value which identifies this gradient descent method.

func (*SGD) NewSupport

func (o *SGD) NewSupport(r, c int) *nn.Payload

NewSupport returns a new support structure with the given dimensions.

Jump to

Keyboard shortcuts

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