TensorFlow中这两个命令之间的区别是什么

时间:2017-01-10 00:32:27

标签: tensorflow

假设你有:

input = tf.placeholder(tf.float32, [None, 784])

声明1:

output = tf.contrib.layers.fully_connected(input, 10, weights_initializer = tf.zeros_initializer, biases_initializer = tf.zeros_initializer)

声明2:

W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
output = tf.matmul(x, W) + b

两个语句中的输出是否返回相同的结果?

1 个答案:

答案 0 :(得分:1)

不,他们不等同。声明1还添加了an activation function

如果设置activation=None,那么它们是相等的。