funcs

package
v0.0.0-...-157c9c8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecantStep

func SecantStep(x0, x1, y0, y1 float64) float64

Types

type DM

type DM func(x, buf []float64) []float64

type Descender

type Descender struct {
	Multi
	G, DG           float64
	X, DX, Momentum []float64
	Steps           int
}

func (*Descender) Init

func (d *Descender) Init() *Descender

Init sets fields to reasonable defaults without overriding any values that have been set.

func (*Descender) Run

func (d *Descender) Run() *Descender

func (*Descender) SetDG

func (d *Descender) SetDG(end float64) *Descender

SetDG such that DG^steps = end

func (*Descender) SetDX

func (d *Descender) SetDX()

func (*Descender) SetG

func (d *Descender) SetG(max float64) *Descender

func (*Descender) Step

func (d *Descender) Step()

type M

type M func([]float64) float64

func (M) PartialDerivative

func (fn M) PartialDerivative(x []float64, idx int) float64

type Multi

type Multi struct {
	Ln int
	M  M
	DM DM
}

func (*Multi) AnalyticDM

func (s *Multi) AnalyticDM(x, buf []float64) []float64

func (*Multi) GetDM

func (s *Multi) GetDM() DM

type S

type S func(float64) float64

func (S) D

func (fn S) D(x float64) float64

func (S) DPrecise

func (fn S) DPrecise(x float64, small cmpr.Tolerance) float64

func (S) NewtonStep

func (fn S) NewtonStep(x float64) (dx, y float64)

func (S) NewtonStepY

func (fn S) NewtonStepY(x, y float64) (dx float64)

func (S) NewtonStepper

func (fn S) NewtonStepper(x float64) Step

func (S) SecantStepper

func (fn S) SecantStepper(x0 float64) Step

type Step

type Step func() (x, y float64)

func (Step) Run

func (s Step) Run(max int, small cmpr.Tolerance) (x, y float64)

Jump to

Keyboard shortcuts

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