srnn

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: 8 Imported by: 0

Documentation

Overview

Package srnn implements the SRNN (Shuffling Recurrent Neural Networks) by Rotman and Wolf, 2020. (https://arxiv.org/pdf/2007.07324.pdf)

This file implements a bidirectional variant of the SRNN, in which the input features are shared among the two directions (Grella, 2021).

Package srnn implements the SRNN (Shuffling Recurrent Neural Networks) by Rotman and Wolf, 2020. (https://arxiv.org/pdf/2007.07324.pdf)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BiModel added in v0.4.0

type BiModel struct {
	nn.BaseModel
	Config    Config
	FC        *stack.Model
	FC2       *linear.Model
	FC3       *linear.Model
	LayerNorm *layernorm.Model
}

BiModel contains the serializable parameters.

func NewBidirectional added in v0.4.0

func NewBidirectional(config Config) *BiModel

NewBidirectional returns a new model with parameters initialized to zeros.

func (*BiModel) Forward added in v0.4.0

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

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

type Config

type Config struct {
	InputSize  int
	HiddenSize int
	NumLayers  int
	HyperSize  int
	OutputSize int
	MultiHead  bool
}

Config provides configuration settings for a SRNN Model.

type Model

type Model struct {
	nn.BaseModel
	Config Config
	FC     *stack.Model
	FC2    *linear.Model
	FC3    *linear.Model
	States []*State `spago:"scope:processor"`
}

Model contains the serializable parameters.

func New

func New(config Config) *Model

New returns a new model with parameters initialized to zeros.

func (*Model) Forward

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

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

type State

type State struct {
	Y ag.Node
	H ag.Node
}

State represent a state of the SRNN recurrent network.

Jump to

Keyboard shortcuts

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