2017年8月19日

摘要: import tensorflow as tfimport numpy as np ##save to file#rember to define the same dtype and shape when restore# W = tf.Variable([[1,2,3],[3,4,5]],dty 阅读全文

posted @ 2017-08-19 14:48 Apelike 阅读(181) 评论(0) 推荐(0) 编辑

摘要: import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#number 1 to 10 datamnist = input_data.read_data_sets('MNIST_data',on 阅读全文

posted @ 2017-08-19 14:47 Apelike 阅读(189) 评论(0) 推荐(0) 编辑

摘要: import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#number 1 to 10 datamnist = input_data.read_data_sets('MNIST_data',on 阅读全文

posted @ 2017-08-19 14:45 Apelike 阅读(185) 评论(0) 推荐(0) 编辑

摘要: import tensorflow as tfimport numpy as np def add_layer(inputs,in_size,out_size,n_layer,activation_function=None): # add one more layer and return the 阅读全文

posted @ 2017-08-19 14:44 Apelike 阅读(261) 评论(0) 推荐(0) 编辑

摘要: import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt def add_layer(inputs,in_size,out_size,activation_function=None): Weights = tf 阅读全文

posted @ 2017-08-19 14:43 Apelike 阅读(265) 评论(0) 推荐(0) 编辑

摘要: import tensorflow as tf input1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32) output = tf.multiply(input1,input2) with tf.Session() a 阅读全文

posted @ 2017-08-19 14:42 Apelike 阅读(106) 评论(0) 推荐(0) 编辑

摘要: import tensorflow as tf state = tf.Variable(0,name='counter') one = tf.constant(1) new_value = tf.add(state,one)update = tf.assign(state,new_value) in 阅读全文

posted @ 2017-08-19 14:41 Apelike 阅读(133) 评论(0) 推荐(0) 编辑

摘要: import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import tensorflow as tfmatrix1 = tf.constant([[3,3]])matrix2 = tf.constant([[2],[2]])protuct = tf.mat 阅读全文

posted @ 2017-08-19 14:39 Apelike 阅读(243) 评论(0) 推荐(0) 编辑

摘要: import tensorflow as tfimport numpy as np #create datax_data = np.random.rand(100).astype(np.float32)y_data = x_data*0.1+0.3 ####create tensorflow str 阅读全文

posted @ 2017-08-19 14:38 Apelike 阅读(171) 评论(0) 推荐(0) 编辑