char

package
v0.0.0-...-f670fa3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure() error

Configure the codec via environment variables

Types

type Char

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

Char is the basic codec for feeding a RNN with text

func NewChar

func NewChar() (*Char, error)

NewChar ...

func (*Char) ApplyDist

func (c *Char) ApplyDist(p []float64) []float64

ApplyDist applies a distribution according to the configuration of the neural network

func (*Char) Decode

func (c *Char) Decode(xs [][]float64) io.Reader

Decode an array of inputs and returns an io.Reader the input is an array of 1-of-K encoded vectors

func (*Char) Encode

func (c *Char) Encode(r io.Reader) [][]float64

Encode the io.Reader into an slice composed of 1-of-K encoded vectors

func (*Char) Feed

func (c *Char) Feed() <-chan rnn.TrainingSet

Feed returns a channel that will be filled with TrainingSets its triggers a go-routine that reads the input and that is putting some data in the channel

func (*Char) GetInfos

func (c *Char) GetInfos() json.Marshaler

GetInfos ...

func (*Char) MarshalBinary

func (c *Char) MarshalBinary() ([]byte, error)

MarshalBinary ...

func (*Char) NewRNN

func (c *Char) NewRNN() *rnn.RNN

NewRNN returns a neural network suitable for this codec

func (*Char) SetLoss

func (c *Char) SetLoss(loss float64)

SetLoss sets the loss and the smoothLoss

func (*Char) UnmarshalBinary

func (c *Char) UnmarshalBinary(b []byte) error

UnmarshalBinary ...

type Infos

type Infos struct {
	SmoothLoss float64
}

Infos ...

func (Infos) MarshalJSON

func (i Infos) MarshalJSON() ([]byte, error)

MarshalJSON ...

Jump to

Keyboard shortcuts

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