tf.contrib.distributions.BaseDistribution

class tf.contrib.distributions.BaseDistribution Simple abstract base class for probability distributions. Implementations of core distributions to be included in the distributions module should subclass Distribution. This base class may be useful to users that want to fulfill a simpler distribution contract.

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.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.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.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.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.copy_graph.get_copied_op()

tf.contrib.copy_graph.get_copied_op(org_instance, graph, scope='') Given an Operation instance from some Graph, returns its namesake from graph, under the specified scope (default ""). If a copy of org_instance is present in graph under the given scope, it will be returned. Args: org_instance: An Operation from some Graph. graph: The Graph to be searched for a copr of org_instance. scope: The scope org_instance is present in. Returns: The `Operation` copy from `graph`.

tf.contrib.crf.CrfForwardRnnCell

class tf.contrib.crf.CrfForwardRnnCell Computes the alpha values in a linear-chain CRF. See http://www.cs.columbia.edu/~mcollins/fb.pdf for reference.