/external/tensorflow/tensorflow/python/training/experimental/ |
D | loss_scaling_gradient_tape_test.py | 34 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 83 loss_scale=[loss_scale_module.FixedLossScale, 88 def test_basic_tapes(self, loss_scale, strategy_fn, use_tf_function): argument 89 loss_scale = loss_scale(32) 94 with lsgt.LossScaleGradientTape(loss_scale) as g: 98 self.assertEqual(loss_scale(), 32) 103 loss_scale=[loss_scale_module.FixedLossScale, 108 def test_output_gradients(self, loss_scale, strategy_fn, use_tf_function): argument 109 loss_scale = loss_scale(32) 114 with lsgt.LossScaleGradientTape(loss_scale) as g: [all …]
|
D | loss_scale_test.py | 36 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 66 loss_scale = loss_scale_module.FixedLossScale(loss_scale_value) 68 update_op, should_apply = loss_scale.update([constant_op.constant(0.)]) 74 self.assertEqual(loss_scale_value, self.evaluate(loss_scale())) 76 update_op, should_apply = loss_scale.update( 81 self.assertEqual(loss_scale_value, self.evaluate(loss_scale())) 85 loss_scale = loss_scale_module.get(123) 86 config = loss_scale.get_config() 87 loss_scale = loss_scale_module.FixedLossScale.from_config(config) 88 self.assertEqual(self.evaluate(loss_scale()), 123.) [all …]
|
D | loss_scale_optimizer_test.py | 38 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 136 loss_scale = 10. 138 opt, loss_scale) 142 self.assertEqual(loss_scale % strategy.num_replicas_in_sync, 0) 144 strategy, var, opt, loss_scale / strategy.num_replicas_in_sync) 156 loss_scale = 10. 157 opt = loss_scale_optimizer.MixedPrecisionLossScaleOptimizer(opt, loss_scale) 158 grad_check_fn = create_identity_with_grad_check_fn(loss_scale) 176 loss_scale = loss_scale_module.DynamicLossScale( 179 opt, loss_scale) [all …]
|
D | mixed_precision.py | 42 def _wrap_optimizer(opt, loss_scale, use_v1_behavior): argument 55 return wrapper_cls(opt, loss_scale) 72 def enable_mixed_precision_graph_rewrite(opt, loss_scale='dynamic'): argument 212 return _enable_mixed_precision_graph_rewrite_base(opt, loss_scale, 220 def enable_mixed_precision_graph_rewrite_v1(opt, loss_scale='dynamic'): argument 328 return _enable_mixed_precision_graph_rewrite_base(opt, loss_scale, 332 def _enable_mixed_precision_graph_rewrite_base(opt, loss_scale, argument 355 opt = _wrap_optimizer(opt, loss_scale, use_v1_behavior=use_v1_behavior)
|
D | loss_scaling_gradient_tape.py | 28 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 93 loss_scale, argument 115 if not isinstance(loss_scale, loss_scale_module.LossScale): 117 "but got: %s" % (loss_scale,)) 125 self._loss_scale = loss_scale 205 distribution, loss_scale_gradient_tapes, loss_scale, target, sources, argument 265 math_ops.greater(loss_scale(), 1))) 276 loss_scale_val = loss_scale() 310 _, ready_to_update = loss_scale.update(grads)
|
D | BUILD | 10 name = "loss_scale", 11 srcs = ["loss_scale.py"], 35 ":loss_scale", 52 ":loss_scale", 78 ":loss_scale", 97 ":loss_scale", 122 ":loss_scale", 137 ":loss_scale",
|
D | loss_scale_optimizer.py | 26 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 64 def __init__(self, opt, loss_scale): argument 74 self._loss_scale = loss_scale_module.get(loss_scale) 133 loss_scale = self._loss_scale() 137 return loss_val * math_ops.cast(loss_scale, loss_val.dtype) 140 return loss * math_ops.cast(loss_scale, loss.dtype) 143 loss_scale = self._loss_scale() 144 loss_scale_reciprocal = 1 / loss_scale
|
/external/tensorflow/tensorflow/python/keras/mixed_precision/ |
D | policy_test.py | 35 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 73 self.assertEqual(repr(mp_policy.PolicyV1('float16', loss_scale=2)), 124 self.assertEqual(policy.loss_scale, None) 126 policy = mp_policy.PolicyV1('float32', loss_scale=None) 127 self.assertEqual(policy.loss_scale, None) 130 policy = mp_policy.PolicyV1('float32', loss_scale=ls) 131 self.assertIs(policy.loss_scale, ls) 133 policy = mp_policy.PolicyV1('float32', loss_scale='dynamic') 134 self.assertIsInstance(policy.loss_scale, loss_scale_module.DynamicLossScale) 137 self.assertIsInstance(policy.loss_scale, loss_scale_module.DynamicLossScale) [all …]
|
D | loss_scale_optimizer.py | 33 from tensorflow.python.keras.mixed_precision import loss_scale as keras_loss_scale_module 40 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 567 def loss_scale(self): member in LossScaleOptimizer 645 return loss_val * math_ops.cast(self.loss_scale, loss_val.dtype) 648 return loss * math_ops.cast(self.loss_scale, loss.dtype) 671 loss_scale_reciprocal = 1. / self.loss_scale 773 loss_scale = keras_loss_scale_module.deserialize( 775 if isinstance(loss_scale, loss_scale_module.FixedLossScale): 777 config['initial_scale'] = loss_scale._loss_scale_value # pylint: disable=protected-access 778 elif isinstance(loss_scale, loss_scale_module.DynamicLossScale): [all …]
|
D | loss_scale_optimizer_test.py | 43 from tensorflow.python.training.experimental import loss_scale as tf_loss_scale_module 95 loss_scale = 10. 97 initial_scale=loss_scale) 98 self.assertEqual(self.evaluate(opt.loss_scale), loss_scale) 99 self.assertIsInstance(opt.loss_scale, ops.Tensor) 103 self.assertEqual(loss_scale % strategy.num_replicas_in_sync, 0) 105 strategy, var, opt, loss_scale / strategy.num_replicas_in_sync) 117 loss_scale = 10. 119 initial_scale=loss_scale) 121 loss_scale) [all …]
|
D | policy.py | 28 from tensorflow.python.keras.mixed_precision import loss_scale as keras_loss_scale_module 343 def __init__(self, name, loss_scale='auto'): argument 368 if loss_scale == 'auto': 369 loss_scale = 'dynamic' if name == 'mixed_float16' else None 373 if loss_scale and self._compute_dtype not in (None, 'float16'): 377 (loss_scale, name)) 378 self._loss_scale = keras_loss_scale_module.get(loss_scale) 381 def loss_scale(self): member in PolicyV1 390 return '<PolicyV1 "%s", loss_scale=%s>' % (self._name, self.loss_scale) 400 config['loss_scale'] = keras_loss_scale_module.serialize(self.loss_scale)
|
D | loss_scale_benchmark.py | 33 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 71 loss_scale = loss_scale_module.FixedLossScale(2.) 79 loss_scale = loss_scale_module.DynamicLossScale( 83 loss_scale = None 84 if loss_scale: 85 opt = loss_scale_optimizer.LossScaleOptimizer(opt, loss_scale) 105 if loss_scale is None:
|
D | loss_scale.py | 27 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 30 def serialize(loss_scale): argument 31 return generic_utils.serialize_keras_object(loss_scale)
|
D | keras_test.py | 59 from tensorflow.python.training.experimental import loss_scale as loss_scale_module 379 loss_scale=None)) 399 loss_scale=2.)) 416 loss_scale=2.)) 665 loss_scale = 8. 675 expected_gradient = loss_scale / batch_size 687 initial_scale=loss_scale) 725 loss_scale = 8. 751 expected_gradient = loss_scale / 2 766 opt, dynamic=False, initial_scale=loss_scale) [all …]
|
/external/tensorflow/tensorflow/tools/api/golden/v1/ |
D | tensorflow.mixed_precision.-fixed-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.FixedLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|
D | tensorflow.train.experimental.-fixed-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.FixedLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|
D | tensorflow.mixed_precision.experimental.-fixed-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.FixedLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|
D | tensorflow.mixed_precision.experimental.-dynamic-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.DynamicLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|
D | tensorflow.train.experimental.-dynamic-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.DynamicLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|
D | tensorflow.mixed_precision.-dynamic-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.DynamicLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|
/external/tensorflow/tensorflow/tools/api/golden/v2/ |
D | tensorflow.train.experimental.-fixed-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.FixedLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|
D | tensorflow.mixed_precision.experimental.-fixed-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.FixedLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|
D | tensorflow.keras.mixed_precision.experimental.-policy.pbtxt | 11 name: "loss_scale" 24 …argspec: "args=[\'self\', \'name\', \'loss_scale\'], varargs=None, keywords=None, defaults=[\'auto…
|
D | tensorflow.mixed_precision.experimental.-dynamic-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.DynamicLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|
D | tensorflow.train.experimental.-dynamic-loss-scale.pbtxt | 3 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.DynamicLossScale\'>" 4 is_instance: "<class \'tensorflow.python.training.experimental.loss_scale.LossScale\'>"
|