本文整理匯總了Python中tensorflow.python.ops.nn_ops.conv2d_backprop_filter方法的典型用法代碼示例。如果您正苦於以下問題:Python nn_ops.conv2d_backprop_filter方法的具體用法?Python nn_ops.conv2d_backprop_filter怎麽用?Python nn_ops.conv2d_backprop_filter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tensorflow.python.ops.nn_ops
的用法示例。
在下文中一共展示了nn_ops.conv2d_backprop_filter方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _Conv2DBackpropInputGrad
# 需要導入模塊: from tensorflow.python.ops import nn_ops [as 別名]
# 或者: from tensorflow.python.ops.nn_ops import conv2d_backprop_filter [as 別名]
def _Conv2DBackpropInputGrad(op, grad):
"""The derivatives for deconvolution.
Args:
op: the Deconvolution op.
grad: the tensor representing the gradient w.r.t. the output
Returns:
the gradients w.r.t. the input and the filter
"""
return [None,
nn_ops.conv2d_backprop_filter(grad, array_ops.shape(op.inputs[1]),
op.inputs[2], op.get_attr("strides"),
op.get_attr("padding"),
op.get_attr("use_cudnn_on_gpu"),
op.get_attr("data_format")),
nn_ops.conv2d(grad, op.inputs[1], op.get_attr("strides"),
op.get_attr("padding"), op.get_attr("use_cudnn_on_gpu"),
op.get_attr("data_format"))]
示例2: _Conv2DGrad
# 需要導入模塊: from tensorflow.python.ops import nn_ops [as 別名]
# 或者: from tensorflow.python.ops.nn_ops import conv2d_backprop_filter [as 別名]
def _Conv2DGrad(op, grad):
strides = op.get_attr("strides")
padding = op.get_attr("padding")
use_cudnn_on_gpu = op.get_attr("use_cudnn_on_gpu")
data_format = op.get_attr("data_format")
shape_0, shape_1 = array_ops.shape_n([op.inputs[0], op.inputs[1]])
return [nn_ops.conv2d_backprop_input(shape_0,
op.inputs[1],
grad,
strides,
padding,
use_cudnn_on_gpu,
data_format),
nn_ops.conv2d_backprop_filter(op.inputs[0],
shape_1,
grad,
strides,
padding,
use_cudnn_on_gpu,
data_format)]
開發者ID:PacktPublishing,項目名稱:Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda,代碼行數:22,代碼來源:nn_grad.py
示例3: _Conv2DGrad
# 需要導入模塊: from tensorflow.python.ops import nn_ops [as 別名]
# 或者: from tensorflow.python.ops.nn_ops import conv2d_backprop_filter [as 別名]
def _Conv2DGrad(op, grad):
return [nn_ops.conv2d_backprop_input(
array_ops.shape(op.inputs[0]), op.inputs[1], grad, op.get_attr("strides"),
op.get_attr("padding"), op.get_attr("use_cudnn_on_gpu"),
op.get_attr("data_format")),
nn_ops.conv2d_backprop_filter(op.inputs[0],
array_ops.shape(op.inputs[1]), grad,
op.get_attr("strides"),
op.get_attr("padding"),
op.get_attr("use_cudnn_on_gpu"),
op.get_attr("data_format"))]