sequential

package
v0.0.0-...-d606bfb Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layer

type Layer interface {
	Forward([][][]float64) [][][]float64
	Backward([][][]float64, float64) [][][]float64
}

Defines a layer with the functions for forward propagation and backward propagation

func InterfaceDecode

func InterfaceDecode(decoder *gob.Decoder) Layer

Decodes binary into a layer

type Model

type Model struct {
	Name   string
	Layers []Layer
}

Defines a sequential model

func Load

func Load(file string) (*Model, error)

Loads a model from a file

func (*Model) Add

func (e *Model) Add(layer Layer)

Adds a layer to the model

func (Model) Fit

func (e Model) Fit(x_train [][][][]float64, y_train [][][][]float64, epochs int, lr float64) Result

Trains the network

func (Model) Predict

func (e Model) Predict(in [][][]float64) [][][]float64

Let the model compute an output for the given input

func (*Model) Print

func (net *Model) Print(epoch int, epochs int, item int, items int, acc float64, er float64, pred [][][]float64, real [][][]float64)

Prints the output

func (*Model) Save

func (e *Model) Save(folder string, file ...string) error

Saves the model to a file

type Result

type Result struct {
	Epochs   int
	Duration time.Duration
	Error    float64
	Accuracy float64
}

Defines a result object to analyze duration, error, acc etc.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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