adam

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 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 Adam

type Adam struct {
	Config
	Alpha    mat.Float
	TimeStep int
}

Adam implements the Adam gradient descent optimization method.

func New

func New(c Config) *Adam

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

func (*Adam) Delta

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

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

func (*Adam) IncExample

func (o *Adam) IncExample()

IncExample beats the occurrence of a new example.

func (*Adam) Label

func (o *Adam) Label() int

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

func (*Adam) NewSupport

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

NewSupport returns a new support structure with the given dimensions.

type Config

type Config struct {
	gd.MethodConfig
	StepSize mat.Float
	Beta1    mat.Float
	Beta2    mat.Float
	Epsilon  mat.Float
}

Config provides configuration settings for an Adam optimizer.

func NewConfig

func NewConfig(stepSize, beta1, beta2, epsilon mat.Float) Config

NewConfig returns a new Adam Config.

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig returns a new Config with generically reasonable default values.

Jump to

Keyboard shortcuts

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