spatial_transformer.py 文件源码

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

项目:statestream 作者: VolkerFischer 项目源码 文件源码
def spatial_transformer_layer(theta, conv_input, downsample_factor=1.0):
    """Spatial Transformer Layer

    This file is highly based on [1]_, written by skaae.

    Implements a spatial transformer layer as described in [2]_.

    Parameters
    ----------
    incomings : a list of [:class:`Layer` instance or a tuple]
        The layers feeding into this layer. The list must have two entries with
        the first network being a convolutional net and the second layer
        being the transformation matrices. The first network should have output
        shape [num_batch, num_channels, height, width]. The output of the
        second network should be [num_batch, 6].
    downsample_fator : float
        A value of 1 will keep the orignal size of the image.
        Values larger than 1 will down sample the image. Values below 1 will
        upsample the image.
        example image: height= 100, width = 200
        downsample_factor = 2
        output image will then be 50, 100

    References
    ----------
    .. [1]  https://github.com/skaae/transformer_network/blob/master/transformerlayer.py

    .. [2]  Spatial Transformer Networks
            Max Jaderberg, Karen Simonyan, Andrew Zisserman, Koray Kavukcuoglu
            Submitted on 5 Jun 2015

    .. [3] https://github.com/taoyizhi68/keras-Spatial-Transformer-Layer/blob/master/SpatialTransformer.py

    """
    output = _transform(theta, conv_input, downsample_factor)
    return output




##########################
#    TRANSFORMER LAYERS  #
##########################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号