Minst数据集简介
小彩笔的摸爬滚打之路orz
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
#from tensorflow.examples.tutorials.mnist import input_data
import input_dataprint ("packs loaded")
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" % (mnist.train.num_examples))
print (" number of test data is %d" % (mnist.test.num_examples))
# What does the data of MNIST look like?
print ("What does the data of MNIST look like?")
trainimg = mnist.train.images
trainlabel = mnist.train.labels
testimg = mnist.test.images
testlabel = mnist.test.labels
print
print (" type of 'trainimg' is %s" % (type(trainimg)))
print (" type of 'trainlabel' is %s" % (type(trainlabel)))
print (" type of 'testimg' is %s" % (type(testimg)))
print (" type of 'testlabel' is %s" % (type(testlabel)))
print (" shape of 'trainimg' is %s" % (trainimg.shape,))
print (" shape of 'trainlabel' is %s" % (trainlabel.shape,))
print (" shape of 'testimg' is %s" % (testimg.shape,))
print (" shape of 'testlabel' is %s" % (testlabel.shape,))
# How does the training data look like?
print ("How does the training data look like?")
nsample = 5
randidx = np.random.randint(trainimg.shape[0], size=nsample)for i in randidx:curr_img = np.reshape(trainimg[i, :], (28, 28)) # 28 by 28 matrix curr_label = np.argmax(trainlabel[i, :] ) # Labelplt.matshow(curr_img, cmap=plt.get_cmap('gray'))plt.title("" + str(i) + "th Training Data " + "Label is " + str(curr_label))print ("" + str(i) + "th Training Data " + "Label is " + str(curr_label))plt.show()
# Batch Learning?
print ("Batch Learning? ")
batch_size = 100
batch_xs, batch_ys = mnist.train.next_batch(batch_size)
print ("type of 'batch_xs' is %s" % (type(batch_xs)))
print ("type of 'batch_ys' is %s" % (type(batch_ys)))
print ("shape of 'batch_xs' is %s" % (batch_xs.shape,))
print ("shape of 'batch_ys' is %s" % (batch_ys.shape,))
Minst数据集简介相关推荐
- 用特征迭代次数区分minst数据集的0和1
既然前面大量的实验都证明了,对于特定结构特定收敛标准的网络的收敛迭代次数是特征的,而这个值和输入有关,那能不能用这个特性去用来对输入进行分类. 本文制作了一个81*11*11-11*11*1的网络 让 ...
- Dataset之WebVision:WebVision数据集简介、下载、使用方法之详细攻略
Dataset之WebVision:WebVision数据集简介.下载.使用方法之详细攻略 目录 WebVision数据集简介 1.WebVision数据集挑战 WebVision数据集下载 WebV ...
- Dataset之Fashion-MNIST:Fashion-MNIST数据集简介、下载、使用方法之详细攻略
Dataset之Fashion-MNIST:Fashion-MNIST数据集简介.下载.使用方法之详细攻略 目录 Fashion-MNIST数据集简介 1.Why we made Fashion-MN ...
- Dataset之Handwritten Digits:Handwritten Digits(手写数字图片识别)数据集简介、安装、使用方法之详细攻略
Dataset之Handwritten Digits:Handwritten Digits(手写数字图片识别)数据集简介.安装.使用方法之详细攻略 目录 Handwritten Digits数据集的简 ...
- Dataset之Rotten Tomatoes:Rotten Tomatoes影评数据集简介、下载、使用方法之详细攻略
Dataset之Rotten Tomatoes:Rotten Tomatoes影评数据集简介.下载.使用方法之详细攻略 目录 Rotten Tomatoes影评数据集简介 Rotten Tomatoe ...
- Dataset之CIFAR-10:CIFAR-10数据集简介、下载、使用方法之详细攻略
Dataset之CIFAR-10:CIFAR-10数据集简介.下载.使用方法之详细攻略 目录 CIFAR-10简介 1.与MNIST 数据集中目比, CIFAR-10 真高以下不同点 2.Tensor ...
- Dataset之MNIST:MNIST(手写数字图片识别+ubyte.gz文件)数据集简介、下载、使用方法(包括数据增强)之详细攻略
Dataset之MNIST:MNIST(手写数字图片识别+ubyte.gz文件)数据集简介+数据增强(将已有MNIST数据集通过移动像素上下左右的方法来扩大数据集为初始数据集的5倍) 目录 MNIST ...
- kitti数据集简介、百度网盘分享 kitti-object、kitti-tracking 全套数据集 自动驾驶
0 写在前面 最近在学习MOT相关知识,之前暑期实习是在一家自动驾驶公司,公司资料里已经有了kitti数据集,所以直接用的,并没有去下载.但是最近自己在学校也用到了这个数据集,所以就去官网下载了,结果 ...
- 【深度学习】Fashion-MNIST数据集简介
文章目录 数据集简介 操作 下载数据集 数据格式 可视化显示 读取小批量 完整代码 备注 数据集简介 不同于MNIST手写数据集,Fashion-MNIST数据集包含了10个类别的图像,分别是:t-s ...
最新文章
- C#开发WPF/Silverlight动画及游戏系列教程(Game Tutorial):(十八) 完美精灵之八面玲珑(WPF Only)②...
- python sql in list
- Java程序员从笨鸟到菜鸟之(一百零六)java操作office和pdf文件(四)页面列表导出cvs,excel、pdf报表.
- WPF特效-拼图游戏
- Redis源码剖析(十二)有序集合跳表实现
- Vue—基础概念—指令
- 基于Redis优化购物车 - 添加商品
- HTML 取消超链接下划线
- 重复类发展手法_正确的护肤手法(动态演示),喜欢就拿去收藏吧!
- 电子合同的履行_每日一“典”丨明确规定电子合同的订立、履行规则
- python2.7安装教程win7_win7 64位环境下,为python2.7 安装pip
- Android 网络请求(OKHttp框架)
- 老男孩python课后作业_老男孩python基础知识练习题(一)上
- 部门年终总结会议有必要开吗?
- VXLAN的广播域BD。
- Java地位无可动摇的12个原因
- 3.Navicat Premium:导入excel文件
- 网易云音乐信息爬取(存储为 csv文件)喜马拉雅音乐爬取
- 最强蜗牛服务器维护祷告bug,最强蜗牛 这个游戏的玩家太难带了,竟然天天希望服务器有事...
- 使用Chinese-Word-Vectors作为pytorch中的预训练向量