birnn

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBiBiLSTM

func NewBiBiLSTM(input, hidden int, merge MergeType) *stack.Model

NewBiBiLSTM returns a new Bidirectional BiLSTM Model.

Types

type MergeType

type MergeType int

MergeType is the enumeration-like type used for the set of merging methods which a BiRNN model Processor can perform.

const (
	// Concat merging method: the outputs are concatenated together (the default)
	Concat MergeType = iota
	// Sum merging method: the outputs are added together
	Sum
	// Prod merging method: the outputs multiplied element-wise together
	Prod
	// Avg merging method: the average of the outputs is taken
	Avg
)

type Model

type Model struct {
	nn.BaseModel
	Positive  nn.StandardModel // positive time direction a.k.a. left-to-right
	Negative  nn.StandardModel // negative time direction a.k.a. right-to-left
	MergeMode MergeType
}

Model contains the serializable parameters.

func New

func New(positive, negative nn.StandardModel, merge MergeType) *Model

New returns a new model with parameters initialized to zeros.

func NewBiCFN

func NewBiCFN(input, hidden int, merge MergeType) *Model

NewBiCFN returns a new Bidirectional CFN Model.

func NewBiGRU

func NewBiGRU(input, hidden int, merge MergeType) *Model

NewBiGRU returns a new Bidirectional GRU Model.

func NewBiLSTM

func NewBiLSTM(input, hidden int, merge MergeType) *Model

NewBiLSTM returns a new Bidirectional LSTM Model.

func NewBiLTM

func NewBiLTM(input int, merge MergeType) *Model

NewBiLTM returns a new Bidirectional LTM Model.

func NewBiMIST

func NewBiMIST(input, hidden, numberOfDelays int, merge MergeType) *Model

NewBiMIST returns a new Bidirectional MIST Model.

func NewBiRAN

func NewBiRAN(input, hidden int, merge MergeType) *Model

NewBiRAN returns a new Bidirectional RAN Model.

func (*Model) Forward added in v0.2.0

func (m *Model) Forward(xs ...ag.Node) []ag.Node

Forward performs the forward step for each input node and returns the result.

Jump to

Keyboard shortcuts

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