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 版)
456
|
第
16
章
子视为单词序列,而不是字符。然后,我们将展示如何使用 RNN 来构建能够执行神经
机器翻译(NMT)的编码器
-
解码器架构。为此,我们使用 TensorFlow Addons 项目提
供的 seq2seq API。
在本章的第二部分,我们将研究注意力机制。顾名思义,这些是神经网络组件,可以学
习选择输入的一部分,模型的其余部分在每个时间步长应重点关注输入部分。首先,我
们将了解如何通过注意力机制来提高基于 RNN 的编码器
-
解码器架构的性能,然后我
们将完全放弃 RNN,研究一种非常成功的仅有注意力机制的架构,称为
Transformer
。
最后,我们介绍 2018 年和 2019 年 NLP 的一些最重要的进展,包括基于 Transformers
的功能强大的语言模型,例如 GPT-2 和 BERT。
让我们从一个简单而有趣的模型入手,该模型可以像莎士比亚那样写作。
16.1 使用字符 RNN 生成莎士比亚文本
在 2015 年著名的博客文章“ The Unreasonable Effectiveness of Recurrent Neural Networks ”
中,Andrej Karpathy 展示了如何训练 RNN 来预测句子中的下一个字符。然后可以将此
Char-RNN
用于生成新颖的文本,一次生成一个字符。这是 Char-RNN 模型经过莎士比
亚全部作品训练后生成的文本的一小部分样本:
PANDARUS:
Alas, I think he shall be come approached ...
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