Skip to Content
深度学习实战手册(R语言版)
book

深度学习实战手册(R语言版)

by Posts & Telecom Press, PKS Prakash, Achyutuni Sri Krishna Rao
May 2024
Intermediate to advanced
246 pages
3h 53m
Chinese
Packt Publishing
Content preview from 深度学习实战手册(R语言版)

第6章 循环神经网络

本章将介绍用于序列数据集建模的循环神经网络(Recurrent Neural Network,RNN)。本章我们将介绍:

  • 建立一个基本的循环神经网络;
  • 建立双向RNN模型;
  • 建立一个深度RNN模型;
  • 建立一个基于长短期记忆的序列模型。

循环神经网络用于数据集的序列建模,这些数据集的观测值之间存在高度的自相关。例如,使用历史数据集预测患者行程或预测给定句子中的下一个单词。这些问题之间的主要共性是输入长度不是常量,并且存在顺序依赖性。标准的神经网络和深度学习模型受到固定大小输入的约束,并产生固定长度的输出。例如,建立在占用数据集上的深度学习神经网络有6个输入特征和一个二项式结果。

机器学习领域中的生成模型(Generative Model)被称为具有生成可观察数据值能力的模型。例如,在图像存储库上训练生成模型以生成类似的新图像。所有生成模型都旨在隐式或显式计算给定数据集上的联合分布。

1.安装并配置TensorFlow。

2.加载所需的软件包:

library(tensorflow)

本节将提供建立RNN模型的步骤。

1.加载MNIST数据集:

# 从TensorFlow库加载MNIST数据集
datasets <- tf$contrib$learn$datasets
mnist <- datasets$mnist$read_data_sets("MNIST-data", one_hot =
TRUE)

2.重置图形并开启交互式会话:

# 重置图形并配置一个交互式会话
tf$reset_default_graph()
sess<-tf$InteractiveSession()
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

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
基于Python的智能文本分析

基于Python的智能文本分析

Benjamin Bengfort, Rebecca Bilbro, Tony Ojeda
面向MapReduce的Hadoop优化

面向MapReduce的Hadoop优化

Posts & Telecom Press, Khaled Tannir
Python计算机视觉和自然语言处理

Python计算机视觉和自然语言处理

Posts & Telecom Press, Álvaro Morena Alberolaï, Gonzalo Molina Gallegoï, Unai Garay Maestreï

Publisher Resources

ISBN: 9781836200932