1.tensorflow和numpy的square和mean很相似: np.square(X)----tf.square(X) np.mean(X)----tf.reduce_mean(X) 注:X为一个列向量 2.加随机数种子,让多次运行的时候,随机数列一致 numpy中:np.random.seed(28) tensorflow中:tf.set_random_seed(28)