Beginning Anomaly Detection Using


LPSRUW PDWSORWOLES\SORW DV



Download 26,57 Mb.
Pdf ko'rish
bet75/283
Sana12.07.2021
Hajmi26,57 Mb.
#116397
1   ...   71   72   73   74   75   76   77   78   ...   283
Bog'liq
Beginning Anomaly Detection Using Python-Based Deep Learning

LPSRUW

PDWSORWOLES\SORW

DV

SOW




PDWSORWOLELQOLQH

SOWLPVKRZ [BWUDLQ>@FPDS JUD\

SOWVKRZ



Figure 3-17.  Importing matplotlib.pyplot to see what these training images 

look like

Figure 3-18.  The output of running the code in figure 

3-17

Chapter 3   IntroduCtIon to deep LearnIng




88

ILJ SOWILJXUH ILJVL]H 

L 

IRU

I

LQ UDQJH

\BWUDLQVKDSH>@ 

LI

\BWUDLQ>I@  



DQG

L 


SOWVXESORW L

SOWLPVKRZ [BWUDLQ>I@FPDS JUD\

SOW[WLFNV >@

SOW\WLFNV >@

L L

SOWVKRZ



Figure 3-19.  Code to generate a plot that shows some example images for a 

specific class

Chapter 3   IntroduCtIon to deep LearnIng




89

Now, extend the shape by a dimension. Right now, the dimensions of the training 

and testing sets are as shown in Figure 

3-21


 and Figure 

3-22


.

Figure 3-20.  The output of running the code in Figure 

3-19

. Notice the amount of 

variation, as well as anomalous data that you would barely consider as numbers

SULQW


[BWUDLQ^`?Q[BWHVW^`?QIRUPDW 

[BWUDLQVKDSH[BWHVWVKDSH



Figure 3-21.  Code to output the shapes of the training and testing data sets

Figure 3-22.  The output of running the code in Figure 

3-21

Chapter 3   IntroduCtIon to deep LearnIng




90

For the purposes of training your model, you want to extend this shape to (60000, 28, 

28, 1) and (10000, 28, 28, 1).

A property of images is that there are three dimensions for color images and two for 

grey scale images. Grey scale images are simply row x column since they don’t have color 

channels. Color images, on the other hand, can be formatted as row x column x channel 

or channel x row x column. For color images, the variable channel is 3 because you want 

to know the pixel values for red, green, and blue (RGB).

In this case, it’s grey scale, so you don’t have to worry about the channel variable, but 

the following code will account for both cases if you end up using a data set with color 

such as the CIFAR-10 data set. CIFAR-10 is extremely similar to MNIST, but this time you 

are classifying the 32x32 images based on labels such as cars, birds, ships, etc. and they 

are in color. Run the code in Figure 

3-23


.

Now convert the values to float32 and divide by 255. Right now, the values are all 

integer values that range from 0 to 255, but you want to convert those values to float and 

make them 0 to 1. This is a process called 




Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   71   72   73   74   75   76   77   78   ...   283




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish