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


Python cntk.output_variable方法代码示例

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


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

示例1: infer_outputs

# 需要导入模块: import cntk [as 别名]
# 或者: from cntk import output_variable [as 别名]
def infer_outputs(self):
        # sampled rois (0, x1, y1, x2, y2)
        # for CNTK the proposal shape is [4 x roisPerImage], and mirrored in Python
        rois_shape = (FreeDimension, 4)
        labels_shape = (FreeDimension, self._num_classes)
        bbox_targets_shape = (FreeDimension, self._num_classes * 4)
        bbox_inside_weights_shape = (FreeDimension, self._num_classes * 4)

        return [output_variable(rois_shape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="rpn_target_rois_raw", needs_gradient=False),
                output_variable(labels_shape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="label_targets_raw", needs_gradient=False),
                output_variable(bbox_targets_shape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="bbox_targets_raw", needs_gradient=False),
                output_variable(bbox_inside_weights_shape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="bbox_inside_w_raw", needs_gradient=False)] 
开发者ID:karolzak,项目名称:cntk-python-web-service-on-azure,代码行数:18,代码来源:proposal_target_layer.py

示例2: infer_outputs

# 需要导入模块: import cntk [as 别名]
# 或者: from cntk import output_variable [as 别名]
def infer_outputs(self):
        # This is a necessary work around since anfter cloning the cloned inputs are just place holders without the proper shape
        if self._cfm_shape is None:
            self._cfm_shape = self.inputs[0].shape
        height, width = self._cfm_shape[-2:]

        if DEBUG:
            print('AnchorTargetLayer: height', height, 'width', width)

        A = self._num_anchors
        # labels
        labelShape = (1, A, height, width)
        # Comment: this layer uses encoded labels, while in CNTK we mostly use one hot labels
        # bbox_targets
        bbox_target_shape = (1, A * 4, height, width)
        # bbox_inside_weights
        bbox_inside_weights_shape = (1, A * 4, height, width)

        return [output_variable(labelShape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="objectness_target", needs_gradient=False),
                output_variable(bbox_target_shape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="rpn_bbox_target", needs_gradient=False),
                output_variable(bbox_inside_weights_shape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="rpn_bbox_inside_w", needs_gradient=False),] 
开发者ID:karolzak,项目名称:cntk-python-web-service-on-azure,代码行数:26,代码来源:anchor_target_layer.py

示例3: infer_outputs

# 需要导入模块: import cntk [as 别名]
# 或者: from cntk import output_variable [as 别名]
def infer_outputs(self):
        # This is a necessary work around since after cloning the cloned inputs are just place holders without the proper shape
        if self._cfm_shape is None:
            self._cfm_shape = self.inputs[0].shape
        height, width = self._cfm_shape[-2:]

        if DEBUG:
            print('AnchorTargetLayer: height', height, 'width', width)

        A = self._num_anchors
        # labels
        labelShape = (1, A, height, width)
        # Comment: this layer uses encoded labels, while in CNTK we mostly use one hot labels
        # bbox_targets
        bbox_target_shape = (1, A * 4, height, width)
        # bbox_inside_weights
        bbox_inside_weights_shape = (1, A * 4, height, width)

        return [output_variable(labelShape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="objectness_target", needs_gradient=False),
                output_variable(bbox_target_shape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="rpn_bbox_target", needs_gradient=False),
                output_variable(bbox_inside_weights_shape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                                name="rpn_bbox_inside_w", needs_gradient=False),] 
开发者ID:Esri,项目名称:raster-deep-learning,代码行数:26,代码来源:anchor_target_layer.py

示例4: infer_outputs

# 需要导入模块: import cntk [as 别名]
# 或者: from cntk import output_variable [as 别名]
def infer_outputs(self):
        # rois blob: holds R regions of interest, each is a 5-tuple
        # (n, x1, y1, x2, y2) specifying an image batch index n and a
        # rectangle (x1, y1, x2, y2)
        # for CNTK the proposal shape is [4 x roisPerImage], and mirrored in Python
        proposalShape = (FreeDimension, 4)

        return [output_variable(proposalShape, self.inputs[0].dtype, self.inputs[0].dynamic_axes,
                            name="rpn_rois_raw", needs_gradient=False)] 
开发者ID:karolzak,项目名称:cntk-python-web-service-on-azure,代码行数:11,代码来源:proposal_layer.py

示例5: infer_outputs

# 需要导入模块: import cntk [as 别名]
# 或者: from cntk import output_variable [as 别名]
def infer_outputs(self):
        batch_axis = C.Axis.default_batch_axis()
        return [
            C.output_variable(
                self.target_shape,
                self.inputs[0].dtype,
                [batch_axis])] 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:9,代码来源:cntk_backend.py


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