aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/kfac
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-01-11 10:14:43 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-11 10:18:45 -0800
commit3abd6e8809ca9c3072e3d846e8313d854e63ed65 (patch)
treeda96c44378929c9eeff117f3b25ed167121831e9 /tensorflow/contrib/kfac
parent0578ee1f652bcad18d5dc7089eab12b6fff60333 (diff)
Changing the default value of the momentum constant to 0.9.
Changing the default value of colocate_gradients_with_ops to True. PiperOrigin-RevId: 181624864
Diffstat (limited to 'tensorflow/contrib/kfac')
-rw-r--r--tensorflow/contrib/kfac/python/ops/estimator.py4
-rw-r--r--tensorflow/contrib/kfac/python/ops/optimizer.py9
2 files changed, 7 insertions, 6 deletions
diff --git a/tensorflow/contrib/kfac/python/ops/estimator.py b/tensorflow/contrib/kfac/python/ops/estimator.py
index 5e1680967c..02b0677824 100644
--- a/tensorflow/contrib/kfac/python/ops/estimator.py
+++ b/tensorflow/contrib/kfac/python/ops/estimator.py
@@ -74,7 +74,7 @@ class FisherEstimator(object):
damping,
layer_collection,
estimation_mode="gradients",
- colocate_gradients_with_ops=False,
+ colocate_gradients_with_ops=True,
cov_devices=None,
inv_devices=None):
"""Create a FisherEstimator object.
@@ -110,7 +110,7 @@ class FisherEstimator(object):
is more expensive to compute than the other three options by a factor
equal to the output dimension, roughly speaking.
colocate_gradients_with_ops: Whether we should request gradients be
- colocated with their respective ops.
+ colocated with their respective ops. (Default: True)
cov_devices: Iterable of device strings (e.g. '/gpu:0'). Covariance
computations will be placed on these devices in a round-robin fashion.
Can be None, which means that no devices are specified.
diff --git a/tensorflow/contrib/kfac/python/ops/optimizer.py b/tensorflow/contrib/kfac/python/ops/optimizer.py
index ecf7f3e4e5..0c9444241f 100644
--- a/tensorflow/contrib/kfac/python/ops/optimizer.py
+++ b/tensorflow/contrib/kfac/python/ops/optimizer.py
@@ -41,12 +41,12 @@ class KfacOptimizer(gradient_descent.GradientDescentOptimizer):
damping,
layer_collection,
var_list=None,
- momentum=0.,
+ momentum=0.9,
momentum_type="regular",
norm_constraint=None,
name="KFAC",
estimation_mode="gradients",
- colocate_gradients_with_ops=False,
+ colocate_gradients_with_ops=True,
cov_devices=None,
inv_devices=None):
"""Initializes the KFAC optimizer with the given settings.
@@ -70,8 +70,8 @@ class KfacOptimizer(gradient_descent.GradientDescentOptimizer):
var_list: Optional list or tuple of variables to train. Defaults to the
list of variables collected in the graph under the key
`GraphKeys.TRAINABLE_VARIABLES`.
- momentum: The momentum value for this optimizer. Only applies when
- momentum_type is 'regular' or 'adam'. (Default: 0)
+ momentum: The momentum decay constant to use. Only applies when
+ momentum_type is 'regular' or 'adam'. (Default: 0.9)
momentum_type: The type of momentum to use in this optimizer, one of
'regular', 'adam', or 'qmodel'. (Default: 'regular')
norm_constraint: float or Tensor. If specified, the update is scaled down
@@ -85,6 +85,7 @@ class KfacOptimizer(gradient_descent.GradientDescentOptimizer):
more a more detailed description of these options.
colocate_gradients_with_ops: Whether we should request gradients we
compute in the estimator be colocated with their respective ops.
+ (Default: True)
cov_devices: Iterable of device strings (e.g. '/gpu:0'). Covariance
computations will be placed on these devices in a round-robin fashion.
Can be None, which means that no devices are specified.