architectures.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:DeepIV 作者: jhartford 项目源码 文件源码
def feature_to_image(features, height=28, width=28, channels=1, backend=K):
    '''
    Reshape a flattened image to the input format for convolutions.

    Can be used either as a Keras operation using the default backend or
    with numpy by using the argument backend=np

    Conforms to the image data format setting defined in ~/.keras/keras.json
    '''
    if K.image_data_format() == "channels_first":
        return backend.reshape(features, (-1, channels, height, width))
    else:
        return backend.reshape(features, (-1, height, width, channels))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号