tf.contrib.crf.crf_unary_score()

tf.contrib.crf.crf_unary_score(tag_indices, sequence_lengths, inputs) Computes the unary scores of tag sequences. Args: tag_indices: A [batch_size, max_seq_len] matrix of tag indices. sequence_lengths: A [batch_size] vector of true sequence lengths. inputs: A [batch_size, max_seq_len, num_tags] tensor of unary potentials. Returns: unary_scores: A [batch_size] vector of unary scores.

tf.contrib.crf.crf_sequence_score()

tf.contrib.crf.crf_sequence_score(inputs, tag_indices, sequence_lengths, transition_params) Computes the unnormalized score for a tag sequence. Args: inputs: A [batch_size, max_seq_len, num_tags] tensor of unary potentials to use as input to the CRF layer. tag_indices: A [batch_size, max_seq_len] matrix of tag indices for which we compute the unnormalized score. sequence_lengths: A [batch_size] vector of true sequence lengths. transition_params: A [num_tags, num_tags] transition matrix.

tf.contrib.crf.crf_log_norm()

tf.contrib.crf.crf_log_norm(inputs, sequence_lengths, transition_params) Computes the normalization for a CRF. Args: inputs: A [batch_size, max_seq_len, num_tags] tensor of unary potentials to use as input to the CRF layer. sequence_lengths: A [batch_size] vector of true sequence lengths. transition_params: A [num_tags, num_tags] transition matrix. Returns: log_norm: A [batch_size] vector of normalizers for a CRF.

tf.contrib.crf.crf_log_likelihood()

tf.contrib.crf.crf_log_likelihood(inputs, tag_indices, sequence_lengths, transition_params=None) Computes the log-likehood of tag sequences in a CRF. Args: inputs: A [batch_size, max_seq_len, num_tags] tensor of unary potentials to use as input to the CRF layer. tag_indices: A [batch_size, max_seq_len] matrix of tag indices for which we compute the log-likehood. sequence_lengths: A [batch_size] vector of true sequence lengths. transition_params: A [num_tags, num_tags] transition matrix, if

tf.contrib.crf.crf_binary_score()

tf.contrib.crf.crf_binary_score(tag_indices, sequence_lengths, transition_params) Computes the binary scores of tag sequences. Args: tag_indices: A [batch_size, max_seq_len] matrix of tag indices. sequence_lengths: A [batch_size] vector of true sequence lengths. transition_params: A [num_tags, num_tags] matrix of binary potentials. Returns: binary_scores: A [batch_size] vector of binary scores.

tf.contrib.crf.CrfForwardRnnCell.__init__()

tf.contrib.crf.CrfForwardRnnCell.__init__(transition_params) Initialize the CrfForwardRnnCell. Args: 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.

tf.contrib.crf.CrfForwardRnnCell.__call__()

tf.contrib.crf.CrfForwardRnnCell.__call__(inputs, state, scope=None) Build the CrfForwardRnnCell. Args: inputs: A [batch_size, num_tags] matrix of unary potentials. state: A [batch_size, num_tags] matrix containing the previous alpha values. scope: Unused variable scope of this cell. Returns: new_alphas, new_alphas: A pair of [batch_size, num_tags] matrices values containing the new alpha values.

tf.contrib.crf.CrfForwardRnnCell.zero_state()

tf.contrib.crf.CrfForwardRnnCell.zero_state(batch_size, dtype) Return zero-filled state tensor(s). Args: batch_size: int, float, or unit Tensor representing the batch size. dtype: the data type to use for the state. Returns: If state_size is an int or TensorShape, then the return value is a N-D tensor of shape [batch_size x state_size] filled with zeros. If state_size is a nested list or tuple, then the return value is a nested list or tuple (of the same structure) of 2-D tensors with the

tf.contrib.crf.CrfForwardRnnCell.state_size

tf.contrib.crf.CrfForwardRnnCell.state_size

tf.contrib.crf.CrfForwardRnnCell.output_size

tf.contrib.crf.CrfForwardRnnCell.output_size