aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/crf
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-02-13 10:36:37 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-02-13 10:40:18 -0800
commitcd3a6effe4f7bbaa3857bfe6432a361a7676507f (patch)
treedb79e5541c90e8dbe62e84d50466d3028899febb /tensorflow/contrib/crf
parent2f93ce3438af1f068eed8c9b01eb508bda3dcdcc (diff)
Fix documentation for the real shape of the output of crf_log_likelihood.
PiperOrigin-RevId: 185552171
Diffstat (limited to 'tensorflow/contrib/crf')
-rw-r--r--tensorflow/contrib/crf/python/ops/crf.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/contrib/crf/python/ops/crf.py b/tensorflow/contrib/crf/python/ops/crf.py
index 62708636c6..faa78769b9 100644
--- a/tensorflow/contrib/crf/python/ops/crf.py
+++ b/tensorflow/contrib/crf/python/ops/crf.py
@@ -166,8 +166,8 @@ def crf_log_likelihood(inputs,
sequence_lengths: A [batch_size] vector of true sequence lengths.
transition_params: A [num_tags, num_tags] transition matrix, if available.
Returns:
- log_likelihood: A scalar containing the log-likelihood of the given sequence
- of tag indices.
+ log_likelihood: A [batch_size] `Tensor` containing the log-likelihood of
+ each example, given the sequence of tag indices.
transition_params: A [num_tags, num_tags] transition matrix. This is either
provided by the caller or created in this function.
"""
@@ -182,7 +182,7 @@ def crf_log_likelihood(inputs,
transition_params)
log_norm = crf_log_norm(inputs, sequence_lengths, transition_params)
- # Normalize the scores to get the log-likelihood.
+ # Normalize the scores to get the log-likelihood per example.
log_likelihood = sequence_scores - log_norm
return log_likelihood, transition_params