
tensorflow
hyl-ocean
github.com/hyl11
展开
-
tensorflow使用基础(1)-- 常量变量和简单线性回归
import tensorflow as tf # 常量乘 a = tf.constant([[2,3]]) b = tf.constant([[1],[2]]) mul = tf.matmul(a,b) with tf.Session() as sess: print("tf mul :" ,sess.run(mul)) print("* " ,sess.run(a*b) ) ...原创 2019-07-14 22:25:24 · 158 阅读 · 0 评论 -
tensorflow使用基础(2)-- 非线性回归
非线性回归 import tensorflow as tf import numpy as np 生成饱含随机噪音的数据 #生成饱含随机噪音的数据 x_data = np.linspace(-1.0, 1.0, 200) noise = np.random.normal(0, 0.02, 200) y_data = x_data ** 2 + noise print(x_data[0:10]...原创 2019-07-15 10:45:16 · 245 阅读 · 0 评论 -
tensorfow使用基础(3)--MNiST--1
import tensorflow as tf import tensorflow.examples.tutorials.mnist as mnist #导入数据 data = mnist.input_data.read_data_sets("MNIST_data", one_hot=True) batch_size = 100 n_batch = data.train.num_examples...原创 2019-07-15 19:43:47 · 202 阅读 · 0 评论 -
tensorflow使用基础(3)-- MNIST--2
# coding: utf-8 # In[3]: import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data #载入数据集 mnist = input_data.read_data_sets("MNIST_data",one_hot=True) #每个批次的大小 batch_size...原创 2019-07-16 15:37:01 · 149 阅读 · 0 评论