摘要:
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) lr=0. 阅读全文
摘要:
import tensorflow as tf import numpy as np W = tf.Variable([[2,1,8],[1,2,5]], dtype=tf.float32, name='weights') b = tf.Variable([[1,2,5]], dtype=tf.float32, name='biases') init= tf.global_variabl... 阅读全文
摘要:
import tensorflow as tf import numpy as np W = tf.Variable(np.arange(6).reshape((2, 3)), dtype=tf.float32, name="weights") b = tf.Variable(np.arange(3).reshape((1, 3)), dtype=tf.float32, name="biase... 阅读全文
摘要:
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # number 1 to 10 data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) def compute_accuracy(v_xs, v_ys... 阅读全文
摘要:
import tensorflow as tf from sklearn.datasets import load_digits #from sklearn.cross_validation import train_test_split from sklearn.model_selection import train_test_split from sklearn.preprocessing... 阅读全文
摘要:
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # number 1 to 10 data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) def add_layer(inputs, in_size... 阅读全文
摘要:
import tensorflow as tf import numpy as np def add_layer(inputs, in_size, out_size, n_layer, activation_function=None): # add one more layer and return the output of this layer layer_n... 阅读全文
摘要:
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt def add_layer(inputs, in_size, out_size, activation_function=None): Weights 阅读全文
摘要:
#TF:TF定义两个变量相乘之placeholder先hold类似变量+feed_dict最后外界传入值 import tensorflow as tf input1 = tf.placeholder(tf.float32) #TF一般只能处理float32的数据类型 input2 = tf.placeholder(tf.float32) #ouput = tf.mul(input1,... 阅读全文
摘要:
#TF:Tensorflow定义变量+常量,实现输出计数功能 import tensorflow as tf state = tf.Variable(0, name='Parameter_name_counter') #print(state.name) one = tf.constant(1) new_value = tf.add(state, one) update = ... 阅读全文