layer.py 文件源码

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

项目:Gumbel-Softmax-VAE-in-tensorflow 作者: JeremyCCHsu 项目源码 文件源码
def discriminator_from_params(x, params):
    with tf.variable_scope('Discriminator'):
        c1 = conv2d(x, [5, 5], [1, 2, 2, 1], 16, scope='conv1', params=params[0:2])
        c2 = conv2d(c1, [5, 5], [1, 2, 2, 1], 64, scope='conv2', params=params[2:4])
        f0 = slim.flatten(c2)
        f1 = dense(f0, 100, scope='dense1', params=params[4:6])
        f2 = dense(f1, 10, scope='dense2', params=params[6:8])
    return f2


    # hid = dense(x, n_hid, scope='l1', params=params[:2], normalized=True)
    # hid = tf.nn.relu(hid)
    # #hid = tf.tanh(hid)
    # hid = dense(hid, n_hid, scope='l2', params=params[2:4], normalized=True)
    # hid = tf.nn.relu(hid)
    # #hid = tf.tanh(hid)
    # out = tf.nn.sigmoid(dense(hid, 1, scope='d_out', params=params[4:]))
    # #
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号