def new_fc_layer( self, bottom, output_size, name ):
shape = bottom.get_shape().as_list()
dim = np.prod( shape[1:] )
x = tf.reshape( bottom, [-1, dim])
input_size = dim
with tf.variable_scope(name):
w = tf.get_variable(
"W",
shape=[input_size, output_size],
initializer=tf.random_normal_initializer(0., 0.005))
b = tf.get_variable(
"b",
shape=[output_size],
initializer=tf.constant_initializer(0.))
fc = tf.nn.bias_add( tf.matmul(x, w), b)
return fc
graph_celeba.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录