build_resnet_sdc.py 文件源码

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

项目:tensorflow-litterbox 作者: rwightman 项目源码 文件源码
def _build_global_context(
        net,
        is_training=False,
        bayesian=False,
        dropout_keep_prob=0.8):

    with tf.variable_scope('GlobalContext'):
        # Reduce feature dimension before LSTM to reduce param count
        net = slim.conv2d(net, 1024, 1, padding='VALID', scope='conv_reduce_1x1')

        #net = slim.dropout(net, dropout_keep_prob, is_training=bayesian or is_training, scope='Dropout')

        rows = tf.unpack(net, axis=1)
        net = tf.pack(
            [lstm.bidir_lstm(r, 512, scope='row%d' % i) for i, r in enumerate(rows)],
            axis=1)
        print('Horizontal LSTM', net.get_shape())

        cols = tf.unpack(net, axis=2)
        net = tf.pack(
            [lstm.bidir_lstm(r, 512, scope='col%d' % i) for i, r in enumerate(cols)],
            axis=2)
        print('Vertical LSTM', net.get_shape())

    return net
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号