- 博客(4)
- 收藏
- 关注
原创 基于Tensorflow的MNIST手写数字识别分类
代码如下:import tensorflow as tfimport numpy as npfrom tensorflow.examples.tutorials.mnist import input_datafrom tensorflow.contrib.tensorboard.plugins import projectorimport timeIMAGE_PIXELS = 2...
2019-03-25 19:50:38 310
原创 TensorFlow实现一元线性回归
代码import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plttrain_x = np.array([[3.3], [4.4], [5.5], [6.71], [6.93], [4.168], [9.779], [6.128], [7.59], [2.167]...
2019-03-07 10:42:16 445
原创 TensorFlow梯度下降
梯度的整个计算过程分为三步:计算梯度处理梯度应用梯度import tensorflow as tfx = tf.Variable(1.0)y = x**2optimizer = tf.train.GradientDescentOptimizer(learning_rate = 0.1)global_step = tf.Variable(0, trainable = False...
2019-03-06 19:41:31 433
原创 TensorFlow用tf.gradients()求梯度发生错误
import tensorflow as tfw1 = tf.Variable([[1, 2]]) #int型res = tf.matmul(w1, [[2], [1]]) #int型grads = tf.gradients(res, w1)with tf.Session() as sess: sess.run(tf.global_variables_initializer...
2019-03-05 22:09:48 999
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人