network

package
v0.0.0-...-5c0e551 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

type Network struct {

	// HiddenWeights []*mat.Dense
	// OutputWeights *mat.Dense
	HiddenWeights  []mat.Matrix
	OutputWeights  mat.Matrix
	HiddenUpdate   []mat.Matrix
	OutputUpdate   mat.Matrix
	HiddenV        []mat.Matrix
	OutputV        mat.Matrix
	HiddenMomentum []mat.Matrix
	OutputMomentum mat.Matrix

	SgdMomentum float64

	LayerOut []mat.Matrix
	// contains filtered or unexported fields
}

Network is a neural network with 3 layers

func CreateNetwork

func CreateNetwork(input int, hidden []int, output int, rate float64, decay float64, SgdMomentum float64, beta1 float64, beta2 float64, eps float64) (net Network)

CreateNetwork creates a neural network with random weights

func (*Network) AdamUpdate

func (net *Network) AdamUpdate(lossMat, lastOut, weight, oldM, oldV mat.Matrix) (mat.Matrix, mat.Matrix, mat.Matrix)

func (*Network) Backward

func (net *Network) Backward(loss [][]float64)

gradient and backward

func (*Network) Forward

func (net *Network) Forward(inputData [][]float64) [][]float64

Forward with gradient

func (*Network) Predict

func (net *Network) Predict(inputData [][]float64) [][]float64

Forward without gradient

Jump to

Keyboard shortcuts

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