decoder

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeysValuesPairs

type KeysValuesPairs = []layer.KeysValuesPairs

KeysValuesPairs contains the layer.KeysValuesPairs for each decoding layer.

type Model

type Model struct {
	nn.BaseModel
	Config             config.Config
	PositionalEncoder  positionalencoder.Encoder
	Layers             []*layer.Layer
	EmbeddingLayerNorm *layernorm.Model
	LayerNorm          *layernorm.Model
}

Model implements a BART decoder.

func New

func New(config config.Config) *Model

New returns a new BART decoder Model.

func (*Model) Decode

func (m *Model) Decode(
	xs []ag.Node,
	encoderHiddenStates []ag.Node,
	pastKeysValuesPairs KeysValuesPairs,
) ([]ag.Node, KeysValuesPairs)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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