srnn

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: BSD-2-Clause Imports: 7 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)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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