一:MNIST数据集 下载地址 MNIST是一个包含很多手写数字图片的数据集,一共4个二进制压缩文件 分别是test set images,test set labels,training set images,training set labels training set包括60000个样本,test set包括10000个样本. test set中前5000个样本来自原始的NISTtraining set,后5000个样本来自原始的NIST test set,因此,前5000个样本比
import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import os %matplotlib inline import matplotlib.pyplot as plt mnist = input_data.read_data_sets('MNIST_data', one_hot=True) class ConvModel(object):
from numpy import * def img2vector(filename): returnVect = zeros((1,1024)) fr = open(filename) for i in range(32): lineStr = fr.readline() for j in range(32): returnVect[0,32*i+j] = int(lineStr[j]) return returnVect def loadImages(dirName): from os i
记得第一次接触手写数字识别数据集还在学习TensorFlow,各种sess.run(),头都绕晕了.自从接触pytorch以来,一直想写点什么.曾经在2017年5月,Andrej Karpathy发表的一篇Twitter,调侃道:l've been using PyTorch a few months now, l've never felt better, l've more energy.My skin is clearer. My eye sight has improved.确实,使用p