m

package
v0.0.0-...-4b97c98 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActivatorLookup = map[string]Activator{
	"sigmoid": Sigmoid{},
	"tanh":    Tanh{},
}

Functions

This section is empty.

Types

type Activator

type Activator interface {
	Activate(i, j int, sum float64) float64
	Deactivate(m mat.Matrix) mat.Matrix
	fmt.Stringer
}

type Config

type Config struct {
	Name         string
	InputNum     int
	HiddenNum    int
	OutputNum    int
	LayerNum     int
	Epochs       int
	TargetLabels []string
	Activator    Activator
	LearningRate float64
}

type Line

type Line struct {
	Inputs  []float64
	Targets []float64
}

type Lines

type Lines []Line

func GetLines

func GetLines(reader io.Reader, inputNum, outputNum int) (Lines, error)

type Network

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

func BestNetworkFor

func BestNetworkFor(name string) (Network, error)

func NewNetwork

func NewNetwork(c Config) Network

func (Network) Analyze

func (net Network) Analyze() error

Analyze tests the network against the test set and outputs the accuracy as well as writing to a log

func (Network) Predict

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

func (*Network) Train

func (net *Network) Train(lines Lines) error

type Sigmoid

type Sigmoid struct{}

func (Sigmoid) Activate

func (s Sigmoid) Activate(i, j int, sum float64) float64

func (Sigmoid) Deactivate

func (s Sigmoid) Deactivate(matrix mat.Matrix) mat.Matrix

func (Sigmoid) String

func (s Sigmoid) String() string

type Tanh

type Tanh struct{}

func (Tanh) Activate

func (t Tanh) Activate(i, j int, sum float64) float64

func (Tanh) Deactivate

func (t Tanh) Deactivate(matrix mat.Matrix) mat.Matrix

func (Tanh) String

func (t Tanh) String() string

Jump to

Keyboard shortcuts

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