crf_forward: CRF forward

Description Usage Arguments Details Value

View source: R/text_ops.R

Description

Computes the alpha values in a linear-chain CRF.

Usage

1
crf_forward(inputs, state, transition_params, sequence_lengths)

Arguments

inputs

A [batch_size, num_tags] matrix of unary potentials.

state

A [batch_size, num_tags] matrix containing the previous alpha values.

transition_params

A [num_tags, num_tags] matrix of binary potentials. This matrix is expanded into a [1, num_tags, num_tags] in preparation for the broadcast summation occurring within the cell.

sequence_lengths

A [batch_size] vector of true sequence lengths.

Details

See http://www.cs.columbia.edu/~mcollins/fb.pdf for reference.

Value

new_alphas: A [batch_size, num_tags] matrix containing the new alpha values.


tfaddons documentation built on July 2, 2020, 2:12 a.m.