tpr

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	nn.BaseModel
	WInS   nn.Param `spago:"type:weights"`
	WInR   nn.Param `spago:"type:weights"`
	WRecS  nn.Param `spago:"type:weights"`
	WRecR  nn.Param `spago:"type:weights"`
	BS     nn.Param `spago:"type:biases"`
	BR     nn.Param `spago:"type:biases"`
	S      nn.Param `spago:"type:weights"`
	R      nn.Param `spago:"type:weights"`
	States []*State `spago:"scope:processor"`
}

Model contains the serializable parameters.

func New

func New(in, nSymbols, dSymbols, nRoles, dRoles int) *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.

func (*Model) LastState

func (m *Model) LastState() *State

LastState returns the last state of the recurrent network. It returns nil if there are no states.

func (*Model) SetInitialState

func (m *Model) SetInitialState(state *State)

SetInitialState sets the initial state of the recurrent network. It panics if one or more states are already present.

type State

type State struct {
	AR ag.Node
	AS ag.Node
	S  ag.Node
	R  ag.Node
	Y  ag.Node
}

State represent a state of the TPR recurrent network.

Jump to

Keyboard shortcuts

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