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 深度學習|內行人的做法
188
|
第五章:打造深度網路
for ( int n = 0; n < nEpochs; n++) {
model.fit( trainingDataIter );
}
在本章後面的例子中,我們還會經常看到這種利用迴圈來管理 epoch 階段的類似做法。
做出預測
如果想要對做出預測有更好地理解,你應該去看一下附錄 E 內容。
訓練組、驗證組與測試組資料
除了從訓練資料中切分出訓練組與測試組之外,也可以再切分出一個驗證組,這種做法
一般認為是最佳的實務做法。我們可以使用驗證組資料,來告訴我們何時可以早一點停
止訓練。
使用多層感知器網路,為 CSV 資料建立模型
DL4J 一開始對於深度學習新鮮人來說似乎有點複雜,因此我們先從如何打造多層感
知器模型開始談起。這樣就可以讓你從比較容易理解的神經網路架構中,看到 DL4J
API 的基本用法。在本書隨附的 GitHub 儲存庫中,有一個針對非線性合成資料集進行
模型化的 Java 範例
5
,其名稱叫做 Saturn(土星)。範例 5-1 就是來自該範例的程式碼
http://bit.ly/2txQnwR
):
範例
5-1
 多層感知器的
Java
程式碼範例
public class MLPClassifierSaturn {
public static void main(String[] args) throws Exception {
Nd4j.ENFORCE_NUMERICAL_STABILITY = true;
int batchSize = 50;
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