aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/factorization
diff options
context:
space:
mode:
authorGravatar Jianwei Xie <xiejw@google.com>2018-03-28 14:36:18 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-03-28 14:38:46 -0700
commite97c9e91e016efd951dc52e82744f607d948bb2a (patch)
treee98e3a2aaec29758533b3c331140b464ff6ce50e /tensorflow/contrib/factorization
parentef6552b544b3c3bf6808be807b30dd9bd4f19669 (diff)
Merge changes from github.
PiperOrigin-RevId: 190835392
Diffstat (limited to 'tensorflow/contrib/factorization')
-rw-r--r--tensorflow/contrib/factorization/kernels/clustering_ops.cc2
-rw-r--r--tensorflow/contrib/factorization/python/ops/factorization_ops.py14
-rw-r--r--tensorflow/contrib/factorization/python/ops/factorization_ops_test.py12
-rw-r--r--tensorflow/contrib/factorization/python/ops/gmm_ops.py4
-rw-r--r--tensorflow/contrib/factorization/python/ops/gmm_test.py2
-rw-r--r--tensorflow/contrib/factorization/python/ops/kmeans_test.py4
-rw-r--r--tensorflow/contrib/factorization/python/ops/wals.py2
7 files changed, 20 insertions, 20 deletions
diff --git a/tensorflow/contrib/factorization/kernels/clustering_ops.cc b/tensorflow/contrib/factorization/kernels/clustering_ops.cc
index dd61f59585..2a6c97e8b9 100644
--- a/tensorflow/contrib/factorization/kernels/clustering_ops.cc
+++ b/tensorflow/contrib/factorization/kernels/clustering_ops.cc
@@ -353,7 +353,7 @@ class NearestNeighborsOp : public OpKernel {
auto worker_threads = *(context->device()->tensorflow_cpu_worker_threads());
const int64 num_threads = worker_threads.num_threads;
// This kernel might be configured to use fewer than the total number of
- // available CPUs on the host machine. To avoid descructive interference
+ // available CPUs on the host machine. To avoid destructive interference
// with other jobs running on the host machine, we must only use a fraction
// of total available L3 cache. Unfortunately, we cannot query the host
// machine to get the number of physical CPUs. So, we use a fixed per-CPU
diff --git a/tensorflow/contrib/factorization/python/ops/factorization_ops.py b/tensorflow/contrib/factorization/python/ops/factorization_ops.py
index 054888e734..8e0ed1d80e 100644
--- a/tensorflow/contrib/factorization/python/ops/factorization_ops.py
+++ b/tensorflow/contrib/factorization/python/ops/factorization_ops.py
@@ -106,7 +106,7 @@ class WALSModel(object):
# the prep_gramian_op for row(column) can be run.
worker_init_op = model.worker_init
- # To be run once per interation sweep before the row(column) update
+ # To be run once per integration sweep before the row(column) update
# initialize ops can be run. Note that in the distributed training
# situations, this should only be run by the chief trainer. All other
# trainers need to block until this is done.
@@ -118,9 +118,9 @@ class WALSModel(object):
init_row_update_op = model.initialize_row_update_op
init_col_update_op = model.initialize_col_update_op
- # Ops to upate row(column). This can either take the entire sparse tensor
- # or slices of sparse tensor. For distributed trainer, each trainer
- # handles just part of the matrix.
+ # Ops to update row(column). This can either take the entire sparse
+ # tensor or slices of sparse tensor. For distributed trainer, each
+ # trainer handles just part of the matrix.
_, row_update_op, unreg_row_loss, row_reg, _ = model.update_row_factors(
sp_input=matrix_slices_from_queue_for_worker_shard)
row_loss = unreg_row_loss + row_reg
@@ -220,7 +220,7 @@ class WALSModel(object):
in the form of [[w_0, w_1, ...], [w_k, ... ], [...]], with the number of
inner lists matching the number of row factor shards and the elements in
each inner list are the weights for the rows of the corresponding row
- factor shard. In this case, w_ij = unonbserved_weight +
+ factor shard. In this case, w_ij = unobserved_weight +
row_weights[i] * col_weights[j].
- If this is a single non-negative real number, this value is used for
all row weights and w_ij = unobserved_weight + row_weights *
@@ -435,7 +435,7 @@ class WALSModel(object):
gramian: Variable storing the gramian calculated from the factors.
Returns:
- A op that updates the gramian with the calcuated value from the factors.
+ A op that updates the gramian with the calculated value from the factors.
"""
partial_gramians = []
for f in factors:
@@ -564,7 +564,7 @@ class WALSModel(object):
Note that specifically this initializes the cache of the row and column
weights on workers when `use_factors_weights_cache` is True. In this case,
- if these weights are being calcualted and reset after the object is created,
+ if these weights are being calculated and reset after the object is created,
it is important to ensure this ops is run afterwards so the cache reflects
the correct values.
"""
diff --git a/tensorflow/contrib/factorization/python/ops/factorization_ops_test.py b/tensorflow/contrib/factorization/python/ops/factorization_ops_test.py
index c813733915..bb5140aeb3 100644
--- a/tensorflow/contrib/factorization/python/ops/factorization_ops_test.py
+++ b/tensorflow/contrib/factorization/python/ops/factorization_ops_test.py
@@ -210,7 +210,7 @@ class WalsModelTest(test.TestCase):
# Test row projection.
# Using the specified projection weights for the 2 row feature vectors.
- # This is expected to reprodue the same row factors in the model as the
+ # This is expected to reproduce the same row factors in the model as the
# weights and feature vectors are identical to that used in model
# training.
projected_rows = wals_model.project_row_factors(
@@ -283,8 +283,8 @@ class WalsModelTest(test.TestCase):
# Test column projection.
# Using the specified projection weights for the 3 column feature vectors.
- # This is expected to reprodue the same column factors in the model as the
- # weights and feature vectors are identical to that used in model
+ # This is expected to reproduce the same column factors in the model as
+ # the weights and feature vectors are identical to that used in model
# training.
projected_cols = wals_model.project_col_factors(
sp_input=sp_feeder,
@@ -385,7 +385,7 @@ class WalsModelTest(test.TestCase):
# Test row projection.
# Using the specified projection weights for the 2 row feature vectors.
- # This is expected to reprodue the same row factors in the model as the
+ # This is expected to reproduce the same row factors in the model as the
# weights and feature vectors are identical to that used in model
# training.
projected_rows = wals_model.project_row_factors(
@@ -462,8 +462,8 @@ class WalsModelTest(test.TestCase):
# Test column projection.
# Using the specified projection weights for the 2 column feature vectors.
- # This is expected to reprodue the same column factors in the model as the
- # weights and feature vectors are identical to that used in model
+ # This is expected to reproduce the same column factors in the model as
+ # the weights and feature vectors are identical to that used in model
# training.
projected_cols = wals_model.project_col_factors(
sp_input=sp_feeder,
diff --git a/tensorflow/contrib/factorization/python/ops/gmm_ops.py b/tensorflow/contrib/factorization/python/ops/gmm_ops.py
index 98d6434f47..14d4c733e3 100644
--- a/tensorflow/contrib/factorization/python/ops/gmm_ops.py
+++ b/tensorflow/contrib/factorization/python/ops/gmm_ops.py
@@ -280,7 +280,7 @@ class GmmAlgorithm(object):
self._define_score_samples()
def _define_full_covariance_probs(self, shard_id, shard):
- """Defines the full covariance probabilties per example in a class.
+ """Defines the full covariance probabilities per example in a class.
Updates a matrix with dimension num_examples X num_classes.
@@ -344,7 +344,7 @@ class GmmAlgorithm(object):
def _define_prior_log_prob_operation(self, shard_id):
"""Computes the prior probability of all samples.
- Updates a vector where each item is the prior probabibility of an
+ Updates a vector where each item is the prior probability of an
input example.
Args:
diff --git a/tensorflow/contrib/factorization/python/ops/gmm_test.py b/tensorflow/contrib/factorization/python/ops/gmm_test.py
index 00a4734eb6..4fc9c96e9d 100644
--- a/tensorflow/contrib/factorization/python/ops/gmm_test.py
+++ b/tensorflow/contrib/factorization/python/ops/gmm_test.py
@@ -210,7 +210,7 @@ class GMMTestQueues(test.TestCase):
return _fn
# This test makes sure that there are no deadlocks when using a QueueRunner.
- # Note that since cluster initialization is dependendent on inputs, if input
+ # Note that since cluster initialization is dependent on inputs, if input
# is generated using a QueueRunner, one has to make sure that these runners
# are started before the initialization.
def test_queues(self):
diff --git a/tensorflow/contrib/factorization/python/ops/kmeans_test.py b/tensorflow/contrib/factorization/python/ops/kmeans_test.py
index 0103cc4439..88eb9cf692 100644
--- a/tensorflow/contrib/factorization/python/ops/kmeans_test.py
+++ b/tensorflow/contrib/factorization/python/ops/kmeans_test.py
@@ -413,7 +413,7 @@ class KMeansCosineDistanceTest(KMeansTestBase):
self.assertAllClose(score, self.true_score, atol=1e-2)
def test_predict_kmeans_plus_plus(self):
- # Most points are concetrated near one center. KMeans++ is likely to find
+ # Most points are concentrated near one center. KMeans++ is likely to find
# the less populated centers.
points = np.array(
[[2.5, 3.5], [2.5, 3.5], [-2, 3], [-2, 3], [-3, -3], [-3.1, -3.2],
@@ -604,7 +604,7 @@ class KMeansTestQueues(test.TestCase):
return _fn
# This test makes sure that there are no deadlocks when using a QueueRunner.
- # Note that since cluster initialization is dependendent on inputs, if input
+ # Note that since cluster initialization is dependent on inputs, if input
# is generated using a QueueRunner, one has to make sure that these runners
# are started before the initialization.
def test_queues(self):
diff --git a/tensorflow/contrib/factorization/python/ops/wals.py b/tensorflow/contrib/factorization/python/ops/wals.py
index 4fe22ea26e..62db3bb4c4 100644
--- a/tensorflow/contrib/factorization/python/ops/wals.py
+++ b/tensorflow/contrib/factorization/python/ops/wals.py
@@ -235,7 +235,7 @@ def _wals_factorization_model_function(features, labels, mode, params):
num_items: An integer, the total number of items of this axis.
update_fn: A function that takes one argument (`sp_input`), and that
returns a tuple of
- * new_factors: A flot Tensor of the factor values after update.
+ * new_factors: A float Tensor of the factor values after update.
* update_op: a TensorFlow op which updates the factors.
* loss: A float Tensor, the unregularized loss.
* reg_loss: A float Tensor, the regularization loss.