当前位置:网站首页>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 边栏推荐
- A simple PHP personal card issuing program v4.0
- 服务器php环境搭建教程,PHP服务端环境搭建图文详解
- Pit encountered during installation of laravel frame
- Exness in-depth good article: dynamic series - Case Analysis of gold liquidity (V)
- Troubleshooting ideas that can solve 80% of faults
- QT official example: QT quick controls - Gallery
- 元宇宙链游系统开发(逻辑开发)丨链游系统开发(详细分析)
- 【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介
- Paddlepaddle 28 build an automatic coder based on convolution
- NM01-独立于总线协议的NM模块功能概述与API定义
猜你喜欢

Leetcode interview question 16.11 Diving board

Nm01 function overview and API definition of nm module independent of bus protocol

深度学习数学基础

Relax again! These fresh students can settle directly in Shanghai

Redis (6) -- object and data structure

What is cloud primordial? This time, I can finally understand!

Leetcode interview question 17.04 Vanishing numbers

Exness in-depth good article: dynamic series - Case Analysis of gold liquidity (V)

又一所双非改考408,会爆冷么?南昌航空大学软件学院

Leetcode interview question 16.17 Continuous sequence
随机推荐
再放寬!這些應届生,可直接落戶上海
M2DGR:多源多场景 地面机器人SLAM数据集(ICRA 2022 )
Web version 3D visualization tool, 97 things programmers should know, AI frontier paper | information daily # 2022.07.01
Basic idea of quick sorting (easy to understand + examples) "suggestions collection"
快速排序基本思路(通俗易懂+例子)「建议收藏」
UE4 用spline畫正圓
故障排查:kubectl报错ValidationError: unknown field \u00a0
Web实时通信技术之Websocket
什么是云原生?这回终于能搞明白了!
Hongmeng's fourth learning
再放宽!这些应届生,可直接落户上海
Matlab中弧度转角度、角度转弧度
Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future
In early summer, Kaiyuan magic changed an electric mosquito racket with killing sound effect!
Distance measurement - Jaccard distance
Unity learning shader notes [81] simple color adjustment post-processing (brightness, saturation, contrast)
第一次去曼谷旅游怎么玩?这份省钱攻略请收好
Leetcode interview question 16.15 Abacus wonderful calculation
初夏,开源魔改一个带击杀音效的电蚊拍!
UE4 draw a circle with spline