摘要: import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data# 载入数据集mnist = input_data.read_data_sets("MNIST_data", one_hot=True)# 阅读全文
posted @ 2018-11-22 21:31 rongye 阅读(4530) 评论(0) 推荐(0) 编辑
摘要: # coding: utf-8# In[2]:import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data# In[3]:#载入数据集mnist = input_data.read_data_set 阅读全文
posted @ 2018-11-22 17:38 rongye 阅读(404) 评论(0) 推荐(0) 编辑
摘要: # coding: utf-8# In[1]:import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt# In[6]:#使用numpy生成200个随机点x_data = np.linspace(-0.5,0.5, 阅读全文
posted @ 2018-11-22 17:05 rongye 阅读(357) 评论(0) 推荐(0) 编辑
摘要: #示例import numpy as npimport tensorflow as tfx_data = np.random.rand(100)y_data = .1 * x_data +.2## 构造一个线性模型优化器#优化 $y = kx+b$#待优化的参数b = tf.Variable(0.) 阅读全文
posted @ 2018-11-22 16:11 rongye 阅读(253) 评论(0) 推荐(0) 编辑
摘要: import tensorflow as tfc1 = tf.constant([[3,3]])c2 = tf.constant([[3],[2]])product = tf.matmul(c1 , c2)with tf.Session() as sess: reslut = sess.run(pr 阅读全文
posted @ 2018-11-22 16:10 rongye 阅读(241) 评论(0) 推荐(0) 编辑