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


Python common.image_data_format方法代码示例

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


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

示例1: depth_to_space

# 需要导入模块: from keras.backend import common [as 别名]
# 或者: from keras.backend.common import image_data_format [as 别名]
def depth_to_space(input, scale, data_format=None):
    """Uses phase shift algorithm to convert
    channels/depth for spatial resolution
    """
    if data_format is None:
        data_format = image_data_format()
    data_format = data_format.lower()
    input = _preprocess_conv2d_input(input, data_format)

    b, k, row, col = input.shape
    out_channels = k // (scale ** 2)
    x = T.reshape(input, (b, scale, scale, out_channels, row, col))
    x = T.transpose(x, (0, 3, 4, 1, 5, 2))
    out = T.reshape(x, (b, out_channels, row * scale, col * scale))

    out = _postprocess_conv2d_output(out, input, None, None, None, data_format)
    return out 
开发者ID:keras-team,项目名称:keras-contrib,代码行数:19,代码来源:theano_backend.py

示例2: depth_to_space

# 需要导入模块: from keras.backend import common [as 别名]
# 或者: from keras.backend.common import image_data_format [as 别名]
def depth_to_space(input, scale, data_format=None):
    ''' Uses phase shift algorithm to convert channels/depth for spatial resolution '''
    if data_format is None:
        data_format = image_data_format()
    data_format = data_format.lower()
    input = _preprocess_conv2d_input(input, data_format)
    out = tf.depth_to_space(input, scale)
    out = _postprocess_conv2d_output(out, data_format)
    return out 
开发者ID:deepakbaby,项目名称:se_relativisticgan,代码行数:11,代码来源:keras_contrib_backend.py

示例3: depth_to_space

# 需要导入模块: from keras.backend import common [as 别名]
# 或者: from keras.backend.common import image_data_format [as 别名]
def depth_to_space(input, scale, data_format=None):
    ''' Uses phase shift algorithm to convert channels/depth for spatial resolution '''
    if data_format is None:
        data_format = image_data_format()

    if data_format == 'channels_first':
        data_format = 'NCHW'
    else:
        data_format = 'NHWC'

    data_format = data_format.lower()
    out = tf.depth_to_space(input, scale, data_format=data_format)
    return out 
开发者ID:OlafenwaMoses,项目名称:Model-Playgrounds,代码行数:15,代码来源:tensorflow_backend.py

示例4: depth_to_space

# 需要导入模块: from keras.backend import common [as 别名]
# 或者: from keras.backend.common import image_data_format [as 别名]
def depth_to_space(input, scale, data_format=None):
    ''' Uses phase shift algorithm to convert channels/depth for spatial resolution '''
    if data_format is None:
        data_format = image_data_format()
    data_format = data_format.lower()
    input = _preprocess_conv2d_input(input, data_format)

    b, k, row, col = input.shape
    out_channels = k // (scale ** 2)
    x = T.reshape(input, (b, scale, scale, out_channels, row, col))
    x = T.transpose(x, (0, 3, 4, 1, 5, 2))
    out = T.reshape(x, (b, out_channels, row * scale, col * scale))

    out = _postprocess_conv2d_output(out, input, None, None, None, data_format)
    return out 
开发者ID:cvjena,项目名称:semantic-embeddings,代码行数:17,代码来源:theano_backend.py


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