Tensorflow
Halosec_Wei
该博主主攻python数据分析,数据挖掘,机器学习方向
展开
-
Tensorflow 变量操作
import tensorflow as tf a = 3 # Create a variable. w = tf.Variable([[0.5,1.0]]) x = tf.Variable([[2.0],[1.0]]) #矩阵乘法 y = tf.matmul(w, x) print(y) #必须先初始化变量,然后才能运行矩阵乘法 init_op = tf.global_variable...原创 2019-07-13 23:13:01 · 175 阅读 · 0 评论 -
Tensorflow 写一个基于梯度下降法的线性拟合
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt %matplotlib inline # 随机生成1000个点,围绕在y=0.1x+0.3的直线周围 num_points = 1000 vectors_set = [] for i in range(num_points): x1 = ...原创 2019-07-13 23:53:26 · 229 阅读 · 0 评论 -
Tensorflow 函数汇总(持续更新)
sess = tf.InteractiveSession() arr = np.array([[31, 23, 4, 24, 27, 34], [18, 3, 25, 0, 6, 35], [28, 14, 33, 22, 20, 8], [13, 30, 21, 19, 7, 9],...原创 2019-07-14 00:54:29 · 366 阅读 · 0 评论 -
Tensorflow 基于minst手写数字数据集合建立逻辑回归分类模型
THE MNIST DATABASE of handwritten digits(点击进入下载4个数据文件) 加载一下数据集 import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import input_data import warnings warnings.filterwarnings("...原创 2019-07-14 01:25:38 · 357 阅读 · 0 评论 -
Tensorflow 基于minst手写数字数据集合建立简单神经网络分类模型
网络架构如上图所示,下面读取数据 import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import input_data import warnings warnings.filterwarnings('ignore') mnist = input_data.read_data_sets('d...原创 2019-07-14 02:01:01 · 495 阅读 · 0 评论 -
Tensorflow 基于minst手写数字数据集合建立CNN分类模型
读取数据 import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import input_data import warnings warnings.filterwarnings('ignore') mnist = input_data.read_data_sets('data/', one_hot...原创 2019-07-14 18:10:22 · 284 阅读 · 0 评论 -
Tensorflow 存储模型
存储模型 import tensorflow as tf v1 = tf.Variable(tf.random_normal([1,2]), name="v1") v2 = tf.Variable(tf.random_normal([2,3]), name="v2") init_op = tf.global_variables_initializer() saver = tf.train.S...原创 2019-07-14 19:24:16 · 142 阅读 · 0 评论 -
Tensorflow 基于minst手写数字数据集合建立RNN分类模型
rnn网络架构 读取数据 import tensorflow as tf import input_data import numpy as np import matplotlib.pyplot as plt print ("Packages imported") import warnings mnist = input_data.read_data_sets("data/", o...原创 2019-07-16 15:27:40 · 297 阅读 · 0 评论