小唐tensorflow
骑着蜗牛逛世界
只当个人学习记录之用
展开
-
1\变量
print (y.eval()) # float32 tf.zeros([3, 4], int32) ==> [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] # 'tensor' is [[1, 2, 3], [4, 5, 6]] tf.zeros_like(tensor) ==> [[0, 0, 0], [0, 0, 0]] tf.o...原创 2018-08-22 10:16:51 · 334 阅读 · 0 评论 -
线性回归
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt # 随机生成1000个点,围绕在y=0.1x+0.3的直线周围 num_points = 1000 vectors_set = [] for i in range(num_points): x1 = np.random.normal(0....原创 2018-08-22 10:23:19 · 134 阅读 · 0 评论 -
3 mnist
print ("Download and Extract MNIST dataset") mnist = input_data.read_data_sets('data/', one_hot=True) print print (" tpye of 'mnist' is %s" % (type(mnist))) print (" number of trian data is %d" % (mn...原创 2018-08-22 10:39:11 · 122 阅读 · 0 评论 -
4逻辑回归
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import input_data mnist = input_data.read_data_sets('data/', one_hot=True) trainimg = mnist.train.images trainlabel ...原创 2018-08-22 10:46:57 · 147 阅读 · 0 评论 -
5 SimpleANN
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import input_data mnist = input_data.read_data_sets('data/', one_hot=True) # NETWORK TOPOLOGIES n_hidden_1 = 256 n_hidde...原创 2018-08-22 10:54:48 · 121 阅读 · 0 评论 -
6\CNN
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import input_data mnist = input_data.read_data_sets('data/', one_hot=True) trainimg = mnist.train.images trainlabel = mni...原创 2018-08-22 11:01:31 · 277 阅读 · 0 评论