当前位置: 首页>>代码示例>>Python>>正文


Python roi_pooling_op.roi_pool_grad方法代码示例

本文整理汇总了Python中roi_pooling_op.roi_pool_grad方法的典型用法代码示例。如果您正苦于以下问题:Python roi_pooling_op.roi_pool_grad方法的具体用法?Python roi_pooling_op.roi_pool_grad怎么用?Python roi_pooling_op.roi_pool_grad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在roi_pooling_op的用法示例。


在下文中一共展示了roi_pooling_op.roi_pool_grad方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _roi_pool_grad

# 需要导入模块: import roi_pooling_op [as 别名]
# 或者: from roi_pooling_op import roi_pool_grad [as 别名]
def _roi_pool_grad(op, grad, _):
  """The gradients for `roi_pool`.
  Args:
    op: The `roi_pool` `Operation` that we are differentiating, which we can use
      to find the inputs and outputs of the original op.
    grad: Gradient with respect to the output of the `roi_pool` op.
  Returns:
    Gradients with respect to the input of `zero_out`.
  """
  data = op.inputs[0]
  rois = op.inputs[1]
  argmax = op.outputs[1]
  pooled_height = op.get_attr('pooled_height')
  pooled_width = op.get_attr('pooled_width')
  spatial_scale = op.get_attr('spatial_scale')

  # compute gradient
  data_grad = roi_pooling_op.roi_pool_grad(data, rois, argmax, grad, pooled_height, pooled_width, spatial_scale)

  return [data_grad, None]  # List of one Tensor, since we have one input 
开发者ID:InterVideo,项目名称:TFFRCNN,代码行数:22,代码来源:roi_pooling_op_grad.py

示例2: _roi_pool_grad

# 需要导入模块: import roi_pooling_op [as 别名]
# 或者: from roi_pooling_op import roi_pool_grad [as 别名]
def _roi_pool_grad(op, grad, _):
  #The gradients for `roi_pool`.
  #Args:
  #  op: The `roi_pool` `Operation` that we are differentiating, which we can use
  #    to find the inputs and outputs of the original op.
  #  grad: Gradient with respect to the output of the `roi_pool` op.
  #Returns:
  #  Gradients with respect to the input of `zero_out`.

  data = op.inputs[0]
  rois = op.inputs[1]
  orientations = op.inputs[2]
  argmax = op.outputs[1]
  pooled_height = op.get_attr('pooled_height')
  pooled_width = op.get_attr('pooled_width')
  spatial_scale = op.get_attr('spatial_scale')

  # compute gradient
  data_grad = roi_pooling_op.roi_pool_grad(data, rois, argmax, grad, orientations, pooled_height, pooled_width, spatial_scale)

  # data_grad contains the gradients with respect to the VGG output and the two 'none's indicate that there is no
  # gradient with respect to the bounding box positions or rotations
  return [data_grad, None, None]  # List of one Tensor, since we have one input 
开发者ID:runa91,项目名称:FRCNN_git,代码行数:25,代码来源:roi_pooling_op_grad.py

示例3: _roi_pool_grad

# 需要导入模块: import roi_pooling_op [as 别名]
# 或者: from roi_pooling_op import roi_pool_grad [as 别名]
def _roi_pool_grad(op, grad, _):
  #The gradients for `roi_pool`.
  #Args:
  #  op: The `roi_pool` `Operation` that we are differentiating, which we can use
  #    to find the inputs and outputs of the original op.
  #  grad: Gradient with respect to the output of the `roi_pool` op.
  #Returns:
  #  Gradients with respect to the input of `zero_out`.

  data = op.inputs[0]
  rois = op.inputs[1]
  argmax = op.outputs[1]
  pooled_height = op.get_attr('pooled_height')
  pooled_width = op.get_attr('pooled_width')
  spatial_scale = op.get_attr('spatial_scale')

  # compute gradient
  data_grad = roi_pooling_op.roi_pool_grad(data, rois, argmax, grad, pooled_height, pooled_width, spatial_scale)

  return [data_grad, None]  # List of one Tensor, since we have one input 
开发者ID:runa91,项目名称:FRCNN_git,代码行数:22,代码来源:roi_pooling_op_grad_orig.py


注:本文中的roi_pooling_op.roi_pool_grad方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。