Python tensorflow.python.training.training_ops.resource_apply_gradient_descent() Examples
The following are 5
code examples of tensorflow.python.training.training_ops.resource_apply_gradient_descent().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
tensorflow.python.training.training_ops
, or try the search function
.
Example #1
Source File: qhm.py From qhoptim with MIT License | 6 votes |
def _resource_apply_dense(self, grad, var): momentum_buffer = self.get_slot(var, "momentum") learning_rate = math_ops.cast(self._learning_rate_tensor, var.dtype.base_dtype) momentum = math_ops.cast(self._momentum_tensor, var.dtype.base_dtype) nu = math_ops.cast(self._nu_tensor, var.dtype.base_dtype) momentum_op = training_ops.resource_apply_momentum( var.handle, momentum_buffer.handle, nu * (1.0 - momentum) * learning_rate, grad, momentum, use_locking=self._use_locking, use_nesterov=False, ) with ops.control_dependencies([momentum_op]): gd_op = training_ops.resource_apply_gradient_descent( var.handle, (1.0 - nu) * learning_rate, grad, use_locking=self._use_locking ) return control_flow_ops.group(momentum_op, gd_op)
Example #2
Source File: gradient_descent.py From lambda-packs with MIT License | 5 votes |
def _resource_apply_dense(self, grad, handle): return training_ops.resource_apply_gradient_descent( handle.handle, math_ops.cast(self._learning_rate_tensor, grad.dtype.base_dtype), grad, use_locking=self._use_locking)
Example #3
Source File: gradient_descent.py From auto-alt-text-lambda-api with MIT License | 5 votes |
def _resource_apply_dense(self, grad, handle): return training_ops.resource_apply_gradient_descent( handle, math_ops.cast(self._learning_rate_tensor, grad.dtype.base_dtype), grad, use_locking=self._use_locking)
Example #4
Source File: gradient_descent.py From Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda with MIT License | 5 votes |
def _resource_apply_dense(self, grad, handle): return training_ops.resource_apply_gradient_descent( handle.handle, math_ops.cast(self._learning_rate_tensor, grad.dtype.base_dtype), grad, use_locking=self._use_locking)
Example #5
Source File: gradient_descent.py From keras-lambda with MIT License | 5 votes |
def _resource_apply_dense(self, grad, handle): return training_ops.resource_apply_gradient_descent( handle, math_ops.cast(self._learning_rate_tensor, grad.dtype.base_dtype), grad, use_locking=self._use_locking)