小彩笔的摸爬滚打之路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数据集简介相关推荐

  1. 用特征迭代次数区分minst数据集的0和1

    既然前面大量的实验都证明了,对于特定结构特定收敛标准的网络的收敛迭代次数是特征的,而这个值和输入有关,那能不能用这个特性去用来对输入进行分类. 本文制作了一个81*11*11-11*11*1的网络 让 ...

  2. Dataset之WebVision:WebVision数据集简介、下载、使用方法之详细攻略

    Dataset之WebVision:WebVision数据集简介.下载.使用方法之详细攻略 目录 WebVision数据集简介 1.WebVision数据集挑战 WebVision数据集下载 WebV ...

  3. Dataset之Fashion-MNIST:Fashion-MNIST数据集简介、下载、使用方法之详细攻略

    Dataset之Fashion-MNIST:Fashion-MNIST数据集简介.下载.使用方法之详细攻略 目录 Fashion-MNIST数据集简介 1.Why we made Fashion-MN ...

  4. Dataset之Handwritten Digits:Handwritten Digits(手写数字图片识别)数据集简介、安装、使用方法之详细攻略

    Dataset之Handwritten Digits:Handwritten Digits(手写数字图片识别)数据集简介.安装.使用方法之详细攻略 目录 Handwritten Digits数据集的简 ...

  5. Dataset之Rotten Tomatoes:Rotten Tomatoes影评数据集简介、下载、使用方法之详细攻略

    Dataset之Rotten Tomatoes:Rotten Tomatoes影评数据集简介.下载.使用方法之详细攻略 目录 Rotten Tomatoes影评数据集简介 Rotten Tomatoe ...

  6. Dataset之CIFAR-10:CIFAR-10数据集简介、下载、使用方法之详细攻略

    Dataset之CIFAR-10:CIFAR-10数据集简介.下载.使用方法之详细攻略 目录 CIFAR-10简介 1.与MNIST 数据集中目比, CIFAR-10 真高以下不同点 2.Tensor ...

  7. Dataset之MNIST:MNIST(手写数字图片识别+ubyte.gz文件)数据集简介、下载、使用方法(包括数据增强)之详细攻略

    Dataset之MNIST:MNIST(手写数字图片识别+ubyte.gz文件)数据集简介+数据增强(将已有MNIST数据集通过移动像素上下左右的方法来扩大数据集为初始数据集的5倍) 目录 MNIST ...

  8. kitti数据集简介、百度网盘分享 kitti-object、kitti-tracking 全套数据集 自动驾驶

    0 写在前面 最近在学习MOT相关知识,之前暑期实习是在一家自动驾驶公司,公司资料里已经有了kitti数据集,所以直接用的,并没有去下载.但是最近自己在学校也用到了这个数据集,所以就去官网下载了,结果 ...

  9. 【深度学习】Fashion-MNIST数据集简介

    文章目录 数据集简介 操作 下载数据集 数据格式 可视化显示 读取小批量 完整代码 备注 数据集简介 不同于MNIST手写数据集,Fashion-MNIST数据集包含了10个类别的图像,分别是:t-s ...

最新文章

  1. C#开发WPF/Silverlight动画及游戏系列教程(Game Tutorial):(十八) 完美精灵之八面玲珑(WPF Only)②...
  2. python sql in list
  3. Java程序员从笨鸟到菜鸟之(一百零六)java操作office和pdf文件(四)页面列表导出cvs,excel、pdf报表.
  4. WPF特效-拼图游戏
  5. Redis源码剖析(十二)有序集合跳表实现
  6. Vue—基础概念—指令
  7. 基于Redis优化购物车 - 添加商品
  8. HTML 取消超链接下划线
  9. 重复类发展手法_正确的护肤手法(动态演示),喜欢就拿去收藏吧!
  10. 电子合同的履行_每日一“典”丨明确规定电子合同的订立、履行规则
  11. python2.7安装教程win7_win7 64位环境下,为python2.7 安装pip
  12. Android 网络请求(OKHttp框架)
  13. 老男孩python课后作业_老男孩python基础知识练习题(一)上
  14. 部门年终总结会议有必要开吗?
  15. VXLAN的广播域BD。
  16. Java地位无可动摇的12个原因
  17. 3.Navicat Premium:导入excel文件
  18. 网易云音乐信息爬取(存储为 csv文件)喜马拉雅音乐爬取
  19. 最强蜗牛服务器维护祷告bug,最强蜗牛 这个游戏的玩家太难带了,竟然天天希望服务器有事...
  20. 使用Chinese-Word-Vectors作为pytorch中的预训练向量

热门文章

  1. 瀑布模型、快速原型模型、增量模型、螺 旋模型的优缺点,说明每种模型的使用范围
  2. shell脚本编程之条件语句【二】(跟着小张一起走)
  3. Qt使用FontAwesome图标字体库
  4. (L2-016)愿天下有情人都是失散多年的兄妹(dfs)
  5. 判定覆盖(Decision coverage)
  6. 程序员和兄弟之间的对话
  7. 搭建LNMP+DISCUZ论坛
  8. 内存气球 linux,KVM的内存气球技术(balloon)
  9. 数据分析中的各种相关性检验方法
  10. show databases没有任何数据库出现,mysql的使用