当前位置:网站首页>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
边栏推荐
- Websocket of Web real-time communication technology
- Redis(6)----对象与数据结构
- Please, stop painting star! This has nothing to do with patriotism!
- 又一所双非改考408,会爆冷么?南昌航空大学软件学院
- QT official example: QT quick controls - Gallery
- 谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
- 第一次去曼谷旅游怎么玩?这份省钱攻略请收好
- Pit encountered during installation of laravel frame
- Web版3D可视化工具,程序员应该知道的97件事,AI前沿论文 | 资讯日报 #2022.07.01
- 【西北工业大学】考研初试复试资料分享
猜你喜欢
Hongmeng's fourth learning
谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
学生抖音宣传母校被吐槽“招生减章”,网友:哈哈哈哈哈哈
Please, stop painting star! This has nothing to do with patriotism!
揭秘得物客服IM全链路通信过程
LightGroupButton* sender = static_cast<LightGroupButton*>(QObject::sender());
M2DGR:多源多场景 地面机器人SLAM数据集(ICRA 2022 )
【每日一题】第二天
新加坡暑假旅游攻略:一天玩转新加坡圣淘沙岛
A good programmer is worth five ordinary programmers!
随机推荐
如何清理废弃pv和其对应的文件夹
300+ documents! This article explains the latest progress of multimodal learning based on transformer
Paddlepaddle 28 build an automatic coder based on convolution
如何优雅的写 Controller 层代码?
Server PHP environment building tutorial, PHP server environment building graphic explanation
文字编辑器 希望有错误的句子用红色标红,文字编辑器用了markdown
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
怎么用ps提取图片颜色分析色彩搭配
Unity learning shader notes [81] simple color adjustment post-processing (brightness, saturation, contrast)
Nm02 nm module call sequence diagram and code interpretation independent of bus protocol
exness深度好文:动性系列-黄金流动性实例分析(五)
The second bullet of AI development and debugging series: the exploration journey of multi machine distributed debugging
一款简约PHP个人发卡程序V4.0版本
A simple PHP personal card issuing program v4.0
The official docker image running container in version 1.5.1 can be set to use MySQL 8 driver?
Leetcode interview question 17.01 Addition without plus sign
What is cloud primordial? This time, I can finally understand!
[Oracle final review] addition, deletion and modification of tablespaces, tables, constraints, indexes and views
“栈”的典型应用—表达式求值(C语言实现)
Leetcode interview question 16.11 Diving board