def _fc(self, bottom, out_size, name):
with tf.variable_scope(name):
_, size = bottom.get_shape().as_list()
weights = tf.get_variable(name=name + "_weights", shape = [size, out_size], initializer=init_ops.random_normal_initializer(stddev=0.01))
biases = tf.get_variable(name=name + "_biases", shape=[out_size], initializer=init_ops.random_normal_initializer(stddev=0.01))
print weights
fc = tf.nn.bias_add(tf.matmul(bottom, weights), biases)
return fc
评论列表
文章目录