birnn

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: BSD-2-Clause Imports: 10 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

Types

type MergeType

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

type Model

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

Model contains the serializable parameters.

func New

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

New returns a new model with parameters initialized to zeros.

func NewBiCFN

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

func NewBiGRU

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

func NewBiLSTM

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

func NewBiLTM

func NewBiLTM(input int, merge MergeType) *Model

func NewBiMIST

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

func NewBiRAN

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

func (*Model) NewProc

func (m *Model) NewProc(ctx nn.Context) nn.Processor

NewProc returns a new processor to execute the forward step.

type Processor

type Processor struct {
	nn.BaseProcessor
	MergeMode MergeType
	Positive  nn.Processor
	Negative  nn.Processor
}

func (*Processor) Forward

func (p *Processor) Forward(xs ...ag.Node) []ag.Node

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

Jump to

Keyboard shortcuts

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