What is the difference between np.mean and tf.reduce_mean?

前端 未结 4 1815
小蘑菇
小蘑菇 2021-01-30 02:02

In the MNIST beginner tutorial, there is the statement

accuracy = tf.reduce_mean(tf.cast(correct_prediction, \"float\"))

tf.cast

4条回答
  •  不知归路
    2021-01-30 02:41

    1 usually refers to rows, and 2 usually refers to columns. Reducing "over" index 1 means to reduce rowwise.

    [1., 2.] is just [ , ].

    This index numbering convention is typical in stats software, especially R.

提交回复
热议问题