crf

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Viterbi

func Viterbi(transitionMatrix mat.Matrix, xs []ag.Node) []int

Viterbi decodes the xs sequence according to the transitionMatrix.

Types

type Model

type Model struct {
	nn.BaseModel
	Size             int
	TransitionScores nn.Param    `spago:"type:weights"`
	Scores           [][]ag.Node `spago:"scope:processor"`
}

Model contains the serializable parameters.

func New

func New(size int) *Model

New returns a new convolution Model, initialized according to the given configuration.

func (*Model) Decode added in v0.2.0

func (m *Model) Decode(emissionScores []ag.Node) []int

Decode performs viterbi decoding.

func (*Model) InitProcessor added in v0.2.0

func (m *Model) InitProcessor()

InitProcessor initializes structures and data useful for the decoding.

func (*Model) NegativeLogLoss added in v0.2.0

func (m *Model) NegativeLogLoss(emissionScores []ag.Node, target []int) ag.Node

NegativeLogLoss computes the negative log loss with respect to the targets.

type ViterbiStructure

type ViterbiStructure struct {
	// contains filtered or unexported fields
}

ViterbiStructure implements Viterbi decoding.

func NewViterbiStructure

func NewViterbiStructure(size int) *ViterbiStructure

NewViterbiStructure returns a new ViterbiStructure ready to use.

Jump to

Keyboard shortcuts

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