networks

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GateCache added in v1.4.0

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

type LSTM added in v1.3.0

type LSTM struct {
	ForgetGate    []layers.Layer
	InputGate     []layers.Layer
	CandidateGate []layers.Layer
	OutputGate    []layers.Layer
	InterpretGate []layers.Layer

	BatchSize    int
	SubBatch     int
	LearningRate float64

	Optimizer optimizers.Optimizer
	// contains filtered or unexported fields
}

func (*LSTM) Evaluate added in v1.3.0

func (network *LSTM) Evaluate(inputSeries [][]float64) []float64

func (*LSTM) EvaluateAcrossInterval added in v1.3.0

func (network *LSTM) EvaluateAcrossInterval(inputSeries [][]float64) [][]float64

func (*LSTM) FromBytes added in v1.3.0

func (network *LSTM) FromBytes(bytes []byte)

func (*LSTM) Initialize added in v1.3.0

func (network *LSTM) Initialize(numInputs int, numOutputs int, ForgetGate []layers.Layer, InputGate []layers.Layer, CandidateGate []layers.Layer, OutputGate []layers.Layer, InterpretGate []layers.Layer)

func (*LSTM) Open added in v1.3.0

func (network *LSTM) Open(dir string, name string)

func (*LSTM) Save added in v1.3.0

func (network *LSTM) Save(dir string, name string)

func (*LSTM) ToBytes added in v1.3.0

func (network *LSTM) ToBytes() []byte

func (*LSTM) Train added in v1.3.0

func (network *LSTM) Train(trainingData []datasets.DataPoint, testingData []datasets.DataPoint, stepSize int, timespan time.Duration)

type Sequential added in v1.4.0

type Sequential struct {
	Layers       []layers.Layer
	BatchSize    int
	SubBatch     int
	LearningRate float64

	Optimizer optimizers.Optimizer
	// contains filtered or unexported fields
}

The baseline network type, this can be used for generic MLPs and CNNs.

func (*Sequential) Evaluate added in v1.4.0

func (network *Sequential) Evaluate(input []float64) []float64

Takes in a single input and passes it through the network.

func (*Sequential) FromBytes added in v1.4.0

func (network *Sequential) FromBytes(bytes []byte)

Essentially the reverse of ToBytes(), this takes the byte array that was put into .lsls file and rebuilds it into the network that was saved.

func (*Sequential) GetErrors added in v1.4.0

func (network *Sequential) GetErrors(dataset []datasets.DataPoint) []datasets.DataPoint

This is just for some sanity checking. This lets you see the datapoints your network guesses wrong on, cause sometimes it gets things wrong it shouldn't, and sometimes you cannot believe someone wrote a 4 like that (I'm looking at you, random MNIST contributor).

func (*Sequential) Initialize added in v1.4.0

func (network *Sequential) Initialize(numInputs int, ls ...layers.Layer)

Takes in the number of inputs this network will accept, as well as a list of the layers constructing the network.

func (*Sequential) Open added in v1.4.0

func (network *Sequential) Open(dir string, name string)

Opens the .lsls file at path [Project Directory]/{dir}/{name}.lsls and populates the network with that saved information.

func (*Sequential) PrettyPrint added in v1.4.0

func (network *Sequential) PrettyPrint() string

func (*Sequential) Save added in v1.4.0

func (network *Sequential) Save(dir string, name string)

Saves your Sequential into a .lsls file, with the path [Project Directory]/{dir}/{name}.lsls.

func (*Sequential) TestOnAndLog added in v1.4.0

func (network *Sequential) TestOnAndLog(dataset []datasets.DataPoint)

Takes in a dataset and prints to Standard Output the loss and accuracy across the dataset.

func (*Sequential) ToBytes added in v1.4.0

func (network *Sequential) ToBytes() []byte

Compresses all the uniquely identifying information in your network (all the weights, and the layer structure) into a long array of bytes, that can be saved directly to a .lsls file.

func (*Sequential) Train added in v1.4.0

func (network *Sequential) Train(dataset []datasets.DataPoint, testingData []datasets.DataPoint, timespan time.Duration)

The main functionality! Accepts a training dataset, a validation dataset, and how long you wish to train for.

Jump to

Keyboard shortcuts

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