adascan.py 文件源码

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

项目:adascan_public 作者: amlankar 项目源码 文件源码
def get_fc_layer(name,size):
    '''
    name - Name to be added after W_ and b_ (can be any datatype convertible to str)
    size - [inp_size,out_size]
    tf.get_variable looks for variable name in current scope and returns it.
    If not found, it uses the initializer
    '''
    with tf.device('/cpu:0'):
        W = tf.get_variable('W_'+str(name),
                            shape=[size[0],size[1]],
                            initializer=tf.contrib.layers.xavier_initializer(uniform=True,
                                                                             seed=None,
                                                                             dtype=tf.float32))
        b = tf.get_variable('b_'+str(name),
                            shape=[size[1]],
                            initializer=tf.random_uniform_initializer(-model_options['init_scale'],\
                                                                      model_options['init_scale']))
    return W,b
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号