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 深度學習|內行人的做法
輸出層
與模型目標的關聯性
|
263
輸出層
與模型目標的關聯性
我們在前一節已經討論過,如何找出與輸入資料型態相匹配的特定神經網路架構。現在
應該是檢查輸出層的時候了,這裡會牽涉到更多的思考,因為輸出層必須考慮到的是,
我們對於所生成模型的期望。
神經網路的每一層,都會有一個相關聯的激活函數,用來決定是否要把訊息傳往下一
層。網路的最後一層叫做「輸出層」,我們同樣也會在輸出層中設置相應的激活函數,
以獲取預期的輸出或答案(分類或迴歸的結果,我們馬上就會看到)。
迴歸模型輸出層
在迴歸模型中,我們會生成一個實數的輸出數字,例如根據坪數所計算出來的房屋價
格。迴歸模型輸出層有兩個主要考慮因素,分別是損失函數與激活函數。
損失函數
針對迴歸輸出層的損失函數,我們有好幾種有效的選擇。最常見的就是均方差
MSE, Mean Squared Error)或平方誤差和(L2)。
激活函數
這裡我們使用的是恆等(線性)輸出函數。
迴歸輸出層可採用的其他激活函數
有時我們可以看到迴歸輸出層採用 tanh 激活函數(所有輸出資料保證落在 -1
1 的範圍內),或是採用 softplus 函數(所有輸出資料保證落在 0 的範
圍內),或是一些調整過的(洩漏型 ReLU、隨機洩漏型 ReLU)線性函數。
如果標籤資料落在 0 的範圍內,迴歸模型可以採用 ReLU 函數嗎?雖然
ReLU 激活函數本身可生成正確的輸出值範圍(也就是 0 ), 但它還是有個
需要特別注意的問題:也就是所謂「死亡 ReLUdying ...
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