當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。