Python
weixin_43408956
这个作者很懒,什么都没留下…
展开
-
Tensorflow学习一
Tensorflow学习小例子 import tensorflow as tf import numpy as np x_data = np.random.rand(100).astype(np.float32)#随机生成的数 y_data = x_data*0.1+0.3#要学习的模型 ## create tensorflow structure start...原创 2019-06-23 11:33:57 · 96 阅读 · 0 评论 -
Tensorflow学习二 Session
import tensorflow as tfmatrix1 = tf.constant([[3,3]])#矩阵matrix2 = tf.constant([[2],[2]])product = tf.matmul(matrix1,matrix2)#矩阵相乘## #methid 1# see = tf.Session()# result = see.run(product)# pr...翻译 2019-06-23 13:15:24 · 103 阅读 · 0 评论 -
Tensorflow学习三Variable
import tensorflow as tfstate = tf.Variable(0,name='counter')#定义为变量one = tf.constant(1)#定义为常量new_value = tf.add(state , one)update = tf.assign(state,new_value)#将new_value赋值给stateinit = tf.initiali...翻译 2019-06-23 13:31:09 · 121 阅读 · 0 评论 -
Tensorflow学习四之placeholder
import tensorflow as tfinput1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32)output = tf.multiply(input1, input2)with tf.Session() as sess:print(sess.run(output,feed_dict={input1:...翻译 2019-06-23 13:42:46 · 207 阅读 · 0 评论 -
Tensorflow学习五之模型的实现
import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltx_data = np.linspace(-1,1,300)[:,np.newaxis]print(x_data.shape)noise = np.random.normal(0,0.05,x_data.shape)y_data = np.sq...翻译 2019-06-23 15:18:21 · 113 阅读 · 0 评论 -
Tensorboard学习六之Tensorboard的实现
import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltx_data = np.linspace(-1,1,300)[:,np.newaxis]print(x_data.shape)noise = np.random.normal(0,0.05,x_data.shape)y_data = np.sq...翻译 2019-06-23 16:18:39 · 186 阅读 · 0 评论 -
tensorflow学习七之tensorborader2
import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltx_data = np.linspace(-1,1,300)[:,np.newaxis]print(x_data.shape)noise = np.random.normal(0,0.05,x_data.shape)y_data = np.sq...翻译 2019-06-23 18:45:48 · 152 阅读 · 0 评论