Beginning Anomaly Detection Using


Temporal Convolutional Network in PyTorch



Download 26,57 Mb.
Pdf ko'rish
bet275/283
Sana12.07.2021
Hajmi26,57 Mb.
#116397
1   ...   271   272   273   274   275   276   277   278   ...   283
Bog'liq
Beginning Anomaly Detection Using Python-Based Deep Learning

 Temporal Convolutional Network in PyTorch

Now, you will look at an example of using PyTorch to construct a temporal convolutional 

network and apply it to the credit card data set from Chapter 

7

.



appendix B   intro to pytorch


393

 Dilated Temporal Convolutional Network

The particular TCN you will reconstruct in PyTorch is the dilated TCN in Chapter 

7

.

Once again, you begin with your imports and define your device (Figure 



B-31

 and 


Figure 

B-32


).

LPSRUW

QXPS\


DV

QS

LPSRUW

SDQGDV

DV

SG

LPSRUW

NHUDV

IURP

VNOHDUQPRGHOBVHOHFWLRQ



LPSRUW

WUDLQBWHVWBVSOLW



IURP

VNOHDUQSUHSURFHVVLQJGDWD



LPSRUW

6WDQGDUG6FDOHU



LPSRUW

WRUFK


LPSRUW

WRUFKQQ



DV

QQ

LPSRUW

WRUFKQQIXQFWLRQDO

DV

)

+\SHUSDUDPHWHUV



QXPBHSRFKV 

QXPBFODVVHV 

OHDUQLQJBUDWH 

GHYLFH WRUFKGHYLFH FXGD LIWRUFKFXGDLVBDYDLODEOH HOVH

FSX

Figure B-31.  Importing the necessary modules

Figure B-32.  The code in Figure 

B-31

 in a Jupyter cell

appendix B   intro to pytorch




394

Next, you load your data set (Figure 

B-33

).

GI SGUHDGBFVY GDWDVHWVFUHGLWFDUGIUDXGFUHGLWFDUGFVY



VHS LQGH[BFRO 1RQH

SULQW


GIVKDSH

GIKHDG


Figure B-33.  Loading your data set and displaying the first five rows

The output should look somewhat like Figure 

B-34

.

Figure B-34.  The output of the code in Figure 



B-33

You need to standardize the values for Time and for Amount since they can get large. 

Everything else has already been standardized in the data set. Run the code in Figure 

B-35


.

GI> $PRXQW @ 


Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   271   272   273   274   275   276   277   278   ...   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