lstm

package module
v0.0.0-...-1581884 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

README

Report card

This is an LSTM implementation is pure go made with gorgonia.

The documentation is in progress.

By now, you can go get github.com/owulveryck/lstm and then run the example:

cd example/train ; go run ../../data/tontons/input.txt It will train the LSTM and predict every now and then.

TODO: the Gorgonia API has changed, I may need to asjust the solver when the 0.9 will be released

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model holds the tensor of the model

func NewModel

func NewModel(inputSize, outputSize int, hiddenSize int) *Model

NewModel creates a new model

func (Model) MarshalBinary

func (m Model) MarshalBinary() ([]byte, error)

MarshalBinary for backup. This function saves the content of the weights matrices and the biais but not the graph structure

func (*Model) Predict

func (m *Model) Predict(ctx context.Context, dataSet datasetter.Float32ReadWriter) error

Predict ...

func (*Model) Train

func (m *Model) Train(ctx context.Context, dset datasetter.FullTrainer, solver G.Solver, pauseChan <-chan struct{}) (<-chan TrainingInfos, <-chan error)

Train the model

func (*Model) UnmarshalBinary

func (m *Model) UnmarshalBinary(data []byte) error

UnmarshalBinary for restore

type TrainingInfos

type TrainingInfos struct {
	Step       int
	Perplexity float32
	Cost       float32
}

TrainingInfos returns info about the current training process

Directories

Path Synopsis
example
this reads the stdin until EOF and output a list of all characters used
this reads the stdin until EOF and output a list of all characters used

Jump to

Keyboard shortcuts

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