Skip to Content
机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
book

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

by Aurélien Géron
October 2020
Intermediate to advanced
693 pages
16h 26m
Chinese
China Machine Press
Content preview from 机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
使用
RNN
和注意力机制进行自然语言处理
|
475
在第一个解码器步长,模型为每个可能的单词输出一个估计的概率。假设前三名的词分
别是“ How”(估计概率为 75%)、“ What”( 3%)和“ You ”( 1%)。到目前为止,这是
我们的短列表。接下来,我们创建模型的三个副本,并使用它们来查找每个句子的下一
个单词。每个模型为词汇表中的每个单词输出一个估计的概率。第一个模型将尝试在句
子“ How”中找到下一个单词,也许它将以 36% 的概率输出单词“ will”, 32% 的概率
为单词“ are”, 16% 的概率为单词“ do”,等等。注意,鉴于句子以“ How”开头,这
些实际上是条件概率。第二个模型将尝试完成句子“What”。它可能会为单词“are”输
出 50% 的条件概率。假设词汇表有 10 000 个单词,则每个模型将输出 10 000 个概率。
接下来,我们计算这些模型会考虑(3
×
10 000)的 30 000 个两个单词的句子中每个句
子的概率。我们通过将每个单词的估计的条件概率乘以它完成的句子的估计概率来做到
这一点。例如,句子“ How”的估计概率为 75%,而单词“ will”的估计条件概率(假
设第一个单词为“How”) 为 36%,因此句子“How will”的估计概率为 75%
×
36% = 7%。
在计算完所有 30 000 个两个单词的句子的概率之后,我们仅仅保留前 3 名。也许它们都
以单词“ How”开头:“ How will”( 27%)、“ How are ...
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

算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977