当前位置:网站首页>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
边栏推荐
- Leetcode interview question 17.01 Addition without plus sign
- 阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
- Web版3D可视化工具,程序员应该知道的97件事,AI前沿论文 | 资讯日报 #2022.07.01
- Paddlepaddle 28 build an automatic coder based on convolution
- iptable端口重定向 MASQUERADE[通俗易懂]
- Troubleshooting: kubectl reports an error validationerror: unknown field \u00a0
- Distance measurement - Jaccard distance
- Web version 3D visualization tool, 97 things programmers should know, AI frontier paper | information daily # 2022.07.01
- The text editor hopes to mark the wrong sentences in red, and the text editor uses markdown
- Websocket of Web real-time communication technology
猜你喜欢
徹底搞懂基於Open3D的點雲處理教程!
【每日一题】第二天
Comprendre complètement le tutoriel de traitement de Point Cloud basé sur open3d!
昨天阿里学长写了一个责任链模式,竟然出现了无数个bug
Qt Official examples: Qt Quick Controls - Gallery
工业软件讲堂-三维CAD设计软件的核心技术解析----讲坛第二次讲座
Responses of different people in technology companies to bugs | daily anecdotes
Thoroughly understand the point cloud processing tutorial based on open3d!
Leetcode 面试题 17.04. 消失的数字
Leetcode interview question 16.11 Diving board
随机推荐
Typical application of "stack" - expression evaluation (implemented in C language)
ESP32-C3入门教程 问题篇⑩——error: implicit declaration of function ‘esp_blufi_close‘;
PR曲线和ROC曲线概念及其区别
Exness in-depth good article: dynamic series - Case Analysis of gold liquidity (V)
Uncover the whole link communication process of dewu customer service im
Responses of different people in technology companies to bugs | daily anecdotes
Relax again! These fresh students can settle directly in Shanghai
谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
Basic idea of quick sorting (easy to understand + examples) "suggestions collection"
The text editor hopes to mark the wrong sentences in red, and the text editor uses markdown
Implementation shadow introduction
Leetcode 面试题 16.11. 跳水板
[Oracle final review] addition, deletion and modification of tablespaces, tables, constraints, indexes and views
Hongmeng's fourth learning
@Component cannot get Dao layer
Redis(6)----对象与数据结构
一款简约PHP个人发卡程序V4.0版本
Is it safe to buy funds on Alipay account
Which securities company has a low, safe and reliable online account opening commission
Rte11 interrupt decoupling function