Skip to Content
深度學習|內行人的做法
book

深度學習|內行人的做法

by Josh Patterson, Adam Gibson
January 2019
Beginner to intermediate
576 pages
14h 31m
Chinese
GoTop Information, Inc.
Content preview from 深度學習|內行人的做法
200
|
第五章:打造深度網路
輸入圖片的載入與向量化
在這個例子中,我們使用了一個名為
MnistDataSetIterator
的自定義資料集迭代器。這是
因為 MNIST 資料集採用的是一種自定義的二進位格式
相應的檔案並不是我們一般
所預期的那種 JPG PNG 檔案。為了讓這個例子更簡單,你可以假設背後已執行過某
些必要的函數,而原始圖片資料已被提取到 NDArray 中,可以讓 DL4J 進行訓練了。下
面的程式碼片段顯示的是
MnistDataSetIterator
實際被使用的情況:
DataSetIterator mnistTrain = new MnistDataSetIterator(batchSize,true,12345);
DataSetIterator mnistTest = new MnistDataSetIterator(batchSize,false,12345);
這段程式碼會把訓練組資料與測試組資料載入到各自的迭代器之中。這段程式還會自動
從網際網路下載 MNIST 資料集,並解壓縮給本機使用。
DL4J LeNet 網路架構
我們可以再次看到,同一個
MultiLayerConfiguration
物件再度被用來描述網路架構,做法
上與我們之前在多層感知器範例中所看到的很類似。不過要注意的是,下面程式碼範例
中所顯示的網路具有更多層,而且所採用的層型態與多層感知器範例中的層型態並不
相同:
/*
構建神經網路
*/
log.info("Build model...."); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

高效能網站建置指南

高效能網站建置指南

Steve Souders
初探深度學習|使用TensorFlow

初探深度學習|使用TensorFlow

Reza Zadeh, Bharath Ramsundar
深度学习实战

深度学习实战

Douwe Osinga

Publisher Resources

ISBN: 9789865020262