深度学习
tensorflow
dear_arty7c
这个作者很懒,什么都没留下…
展开
-
泰坦尼克号生存预测
泰坦尼克号生存预测import pandas as pdfrom sklearn import preprocessingimport tensorflow as tfimport matplotlib.pyplot as plt# 使用panda读取处理数据data_file_path = "./titanic3.xls"df_data = pd.read_excel(data_file_path)# print(df_data.describe())selected_cols = [原创 2020-11-09 16:11:08 · 786 阅读 · 0 评论 -
CIFAR_10图像识别
import numpy as npimport pickle as pimport matplotlib.pyplot as pltimport tensorflow as tffrom sklearn.preprocessing import OneHotEncoderimport osfrom time import time# 读取数据# 分批次读取数据,每次10000def load_CIFAR_batch(filename): """ load single bat原创 2020-11-09 16:00:42 · 922 阅读 · 0 评论 -
基于多层神经网络的手写数字识别
基于多层神经网络的手写数字识别import tensorflow as tfimport osimport matplotlib.pyplot as pltimport numpy as np#下载读取数据from tensorflow.examples.tutorials.mnist import input_datamnist=input_data.read_data_sets("./MNIST_data/",one_hot=True)#模型构建#定义全连接层函数def f原创 2020-11-02 10:25:35 · 639 阅读 · 0 评论 -
单变量线性回归
单变量线性回归import matplotlib.pyplot as pltimport numpy as npimport tensorflow as tfnp.random.seed(5)#创建数据x_data=np.linspace(-1,1,100)y_data=2*x_data+1.0+np.random.randn(*x_data.shape)*0.4#对创建的数据画图plt.scatter(x_data,y_data)plt.plot(x_data,2*x_data+原创 2020-10-30 20:42:16 · 225 阅读 · 0 评论 -
tensorflow基础
tensorflow基础1.输出hello wordimport tensorflow as tfhello=tf.constant("hello word")sess=tf.Session()print(sess.run(hello))2.tensor(“Add=0”,shape=(),dtype=float32)名字(name)节点名称,来自节点的第几个输出形状(shape)张量的维度信息,上面表示标量类型(type)每个张量会有一个唯一的类型3.张量的形状scalar=t原创 2020-10-30 20:37:38 · 134 阅读 · 0 评论 -
基于一个隐藏层神经网络的手写数字识别
基于一个隐层神经网络的手写数字识别import tensorflow as tfimport osimport matplotlib.pyplot as pltimport numpy as np#下载读取数据from tensorflow.examples.tutorials.mnist import input_datamnist=input_data.read_data_sets("./MNIST_data/",one_hot=True)#模型构建#输入数据占位符x=tf.p原创 2020-10-30 20:25:19 · 428 阅读 · 0 评论