aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-07-13 16:29:01 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-07-13 16:33:33 -0700
commitcfd0bf52094e637b516c71164761c7687e0af134 (patch)
tree837d77e63d3399593b73b0f536299c807c67a6bc
parent2429ce2c5b28986efe21d4b91d90c8f10088b81d (diff)
Adding cautionary comments on the use of use_factors_weights_cache in the case where the weights are computed outside and set to the WALS object.
PiperOrigin-RevId: 161882927
-rw-r--r--tensorflow/contrib/factorization/python/ops/factorization_ops.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/tensorflow/contrib/factorization/python/ops/factorization_ops.py b/tensorflow/contrib/factorization/python/ops/factorization_ops.py
index fb400dbcea..054888e734 100644
--- a/tensorflow/contrib/factorization/python/ops/factorization_ops.py
+++ b/tensorflow/contrib/factorization/python/ops/factorization_ops.py
@@ -229,7 +229,13 @@ class WALSModel(object):
a single number or vice versa.
col_weights: See row_weights.
use_factors_weights_cache: When True, the factors and weights will be
- cached on the workers before the updates start. Defaults to True.
+ cached on the workers before the updates start. Defaults to True. Note
+ that the weights cache is initialized through `worker_init`, and the
+ row/col factors cache is initialized through
+ `initialize_{col/row}_update_op`. In the case where the weights are
+ computed outside and set before the training iterations start, it is
+ important to ensure the `worker_init` op is run afterwards for the
+ weights cache to take effect.
use_gramian_cache: When True, the Gramians will be cached on the workers
before the updates start. Defaults to True.
"""
@@ -554,7 +560,14 @@ class WALSModel(object):
@property
def worker_init(self):
- """Op to initialize worker state once before starting any updates."""
+ """Op to initialize worker state once before starting any updates.
+
+ 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,
+ it is important to ensure this ops is run afterwards so the cache reflects
+ the correct values.
+ """
return self._worker_init
@property