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 深度學習|內行人的做法
264
|
第六章:深度網路的調整
分類模型輸出層
在分類模型中,我們的輸出層會有 N 個輸出單元,而且我們會針對每一個輸出單元,
生成一個類別分數。如果 N
= 1,就表示我們的模型只帶有單一標籤。這種情況就等於
是把輸出的結果,分類成滿足或不滿足某條件(例如垃圾郵件或非垃圾郵件)。如果
N
> 1,我們就會針對每個類別對輸入進行評分,而且採用不同的輸出層設定。只要採用
這種做法,我們就可以把文件歸類到某個類別(例如體育、商業和政治)。它也可以用
來處理同一文件分屬多種類別(例如「體育 + 商業」)的情況。
單一標籤分類模型
在基本的單一標籤(或二元分類器)的範例中,我們可使用 S 型激活函數來做為輸出
層。它會提供一個介於 0.0 到 1.0 之間的單一輸出,告訴我們文件是否確實是垃圾郵件。
如果使用單一輸出標籤(用 0.0 到 1.0 範圍內的某個值來表示它屬於哪一類),我們就會
搭配使用交叉熵(cross-entropy)損失函數。
二元分類器應該採用單輸出還是雙輸出?
我們也可以使用 softmax 激活函數,做為二元分類器的一種變形做法,其輸
出層會有兩個輸出。這種做法所輸出的結果,是兩個總和為 1.0 的雙精度浮
點數,其中比較大的值對應的就是模型所推測的標籤索引值。在這種採用
softmax 做為激活函數的變形做法中,我們會搭配使用 MCXENT(多類別交叉
熵,multiclass cross-entropy)損失函數。
究竟哪一種輸出層才是二元分類模型的最佳做法,這其中存在爭議。輸出層使
用單輸出單元( ...
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

精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly
机器学习和AI精粹

机器学习和AI精粹

诺亚·吉夫特
初探深度學習|使用TensorFlow

初探深度學習|使用TensorFlow

Reza Zadeh, Bharath Ramsundar

Publisher Resources

ISBN: 9789865020262