crf

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: BSD-2-Clause Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Viterbi

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

Viterbi decodes the xs sequence according to the transitionMatrix.

Types

type Model

type Model struct {
	nn.Module
	Size             int
	TransitionScores *nn.Param
}

Model contains the serializable parameters.

func New

func New[T float.DType](size int) *Model

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

func (*Model) Decode

func (m *Model) Decode(emissionScores []mat.Tensor) []int

Decode performs viterbi decoding.

func (*Model) NegativeLogLoss

func (m *Model) NegativeLogLoss(emissionScores []mat.Tensor, target []int) mat.Tensor

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