当前位置:网站首页>Use MNIST in tensorflow 2_ 784 data set for handwritten digit recognition
Use MNIST in tensorflow 2_ 784 data set for handwritten digit recognition
2022-07-02 18:48:00 【GaoZhenwen2】
import tensorflow._api.v2.compat.v1 as tf
tf.disable_v2_behavior
tf.compat.v1.disable_eager_execution()
import numpy as np
# Statement to use TensorFlow1 edition
from scipy.io import loadmat
mnist = loadmat('G:/pythonProject/MachineLearning/2 classification /mnist-original.mat')# hold mnist_784 Data sets are downloaded separately , And then use loadmat Read
X = mnist['data'].T# This must be transposed , Because the ranks are opposite !!!!!
y = mnist['label'].T.flatten()# Expand the data
y= y.astype(np.uint8)# Change format to uint8
# And then use pandas Label y Heat code , Finally, convert the data into ndarray Format
import pandas as pd
y_pd = pd.Series(y)
y_oneHot = pd.get_dummies(y_pd)
y = np.array(y_oneHot.values)
# Okay X,y Now it can be used for training
边栏推荐
- Simulateur nightGod + application de test de capture de paquets Fiddler
- UML 类图
- Unity学习shader笔记[八十二]增强单通道颜色渲染的黑白处理
- Paddlepaddle 28 build an automatic coder based on convolution
- UE4 用spline画正圆
- 【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介
- C语言中函数参数传递的三种方式
- AI开发调试系列第二弹:多机分布式调测探索之旅
- Eliminate the yellow alarm light on IBM p750 small computer [easy to understand]
- 初夏,开源魔改一个带击杀音效的电蚊拍!
猜你喜欢
故障排查:kubectl报错ValidationError: unknown field \u00a0
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
Leetcode interview question 16.11 Diving board
夜神模拟器+Fiddler抓包测试App
呆错图床系统源码图片CDN加速与破J防盗链功能
Leetcode interview question 16.17 Continuous sequence
任职 22 年,PowerShell 之父将从微软离职:曾因开发 PowerShell 被微软降级过
Web版3D可视化工具,程序员应该知道的97件事,AI前沿论文 | 资讯日报 #2022.07.01
又一所双非改考408,会爆冷么?南昌航空大学软件学院
Simulateur nightGod + application de test de capture de paquets Fiddler
随机推荐
Distance measurement - Jaccard distance
初夏,开源魔改一个带击杀音效的电蚊拍!
Industrial software lecture - core technology analysis of 3D CAD design software - the second lecture of the Forum
哪个券商公司网上开户佣金低又安全又可靠
阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
Web版3D可视化工具,程序员应该知道的97件事,AI前沿论文 | 资讯日报 #2022.07.01
Leetcode (81) -- search rotation sort array II
Iframe nesting details
再放宽!这些应届生,可直接落户上海
Ali was wildly asked by the interviewer on three sides. Redis dared not write 'proficient' on his resume anymore
深度神经网络总结
paddlepaddle 28 搭建基于卷积的自动编码机
Pit encountered during installation of laravel frame
NM02-独立于总线协议的NM模块调用序列图及代码解释
ESP32-C3入门教程 问题篇⑪——esp-tls: create_ssl_handle failed, tls_io_instance->options.trusted_certs null
@Component 拿不到dao层
工业软件讲堂-三维CAD设计软件的核心技术解析----讲坛第二次讲座
Web实时通信技术之Websocket
300+篇文献!一文详解基于Transformer的多模态学习最新进展
cJSON 使用详解