birnncrf

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package birnncrf provides an implementation of a Bidirectional Recurrent Neural Network (BiRNN) with a Conditional Random Fields (CRF) on tom.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	nn.BaseModel
	BiRNN  *birnn.Model
	Scorer *linear.Model
	CRF    *crf.Model
}

Model contains the serializable parameters.

func New added in v0.2.0

func New(biRNN *birnn.Model, scorer *linear.Model, crf *crf.Model) *Model

New returns a new model with parameters initialized to zeros.

func (*Model) Decode added in v0.2.0

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

Decode performs the viterbi decoding.

func (*Model) Forward added in v0.2.0

func (m *Model) Forward(xs ...ag.Node) []ag.Node

Forward performs the forward step for each input node and returns the result.

func (*Model) NegativeLogLoss added in v0.2.0

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

NegativeLogLoss computes the negative log loss with respect to the targets. TODO: the CRF backward tests are still missing

func (*Model) Predict added in v0.2.0

func (m *Model) Predict(xs []ag.Node) []int

Predict performs Decode(Forward(xs)).

Jump to

Keyboard shortcuts

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