Home > Store

Learning Deep Learning: Theory and Practice of Neural Networks, Computer Vision, Natural Language Processing, and Transformers Using TensorFlow

Register your product to gain access to bonus material or receive a coupon.

Learning Deep Learning: Theory and Practice of Neural Networks, Computer Vision, Natural Language Processing, and Transformers Using TensorFlow

Best Value Purchase

Book + eBook Bundle

  • Your Price: $80.29
  • List Price: $132.98
  • Includes EPUB and PDF
  • About eBook Formats
  • This eBook includes the following formats, accessible from your Account page after purchase:

    ePub EPUB The open industry format known for its reflowable content and usability on supported mobile devices.

    Adobe Reader PDF The popular standard, used most often with the free Acrobat® Reader® software.

    This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

More Purchase Options


  • Your Price: $59.99
  • List Price: $74.99
  • Usually ships in 24 hours.

eBook (Watermarked)

  • Your Price: $46.39
  • List Price: $57.99
  • Includes EPUB and PDF
  • About eBook Formats
  • This eBook includes the following formats, accessible from your Account page after purchase:

    ePub EPUB The open industry format known for its reflowable content and usability on supported mobile devices.

    Adobe Reader PDF The popular standard, used most often with the free Acrobat® Reader® software.

    This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.



  • All students need to get started, and get resultsno machine learning background required.
  • Packed with clear, thorough explanations and concise, well-annotated code examples.
  • Presents an extensive set of code examples built with TensorFlow and the Keras API, with complementary PyTorch examples provided online.
  • Thoroughly demonstrates the use of deep learning in an advanced image captioning network application that combines image and language processing.
  • Straight from NVIDIA, creator of the GPU hardware that brings deep learning models to life.


  • Copyright 2022
  • Dimensions: 7-3/8" x 9-1/8"
  • Pages: 752
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-747035-5
  • ISBN-13: 978-0-13-747035-8

NVIDIA's Full-Color Guide to Deep Learning: All You Need to Get Started and Get Results

"To enable everyone to be part of this historic revolution requires the democratization of AI knowledge and resources. This book is timely and relevant towards accomplishing these lofty goals."
--From the foreword by Dr. Anima Anandkumar, Bren Professor, Caltech, and Director of ML Research, NVIDIA

"Ekman uses a learning technique that in our experience has proven pivotal to successasking the reader to think about using DL techniques in practice. His straightforward approach is refreshing, and he permits the reader to dream, just a bit, about where DL may yet take us."
--From the foreword by Dr. Craig Clawson, Director, NVIDIA Deep Learning Institute

Deep learning (DL) is a key component of today's exciting advances in machine learning and artificial intelligence. Learning Deep Learning is a complete guide to DL. Illuminating both the core concepts and the hands-on programming techniques needed to succeed, this book is ideal for developers, data scientists, analysts, and others--including those with no prior machine learning or statistics experience.

After introducing the essential building blocks of deep neural networks, such as artificial neurons and fully connected, convolutional, and recurrent layers, Magnus Ekman shows how to use them to build advanced architectures, including the Transformer. He describes how these concepts are used to build modern networks for computer vision and natural language processing (NLP), including Mask R-CNN, GPT, and BERT. And he explains how a natural language translator and a system generating natural language descriptions of images.

Throughout, Ekman provides concise, well-annotated code examples using TensorFlow with Keras. Corresponding PyTorch examples are provided online, and the book thereby covers the two dominating Python libraries for DL used in industry and academia. He concludes with an introduction to neural architecture search (NAS), exploring important ethical issues and providing resources for further learning.

  • Explore and master core concepts: perceptrons, gradient-based learning, sigmoid neurons, and back propagation
  • See how DL frameworks make it easier to develop more complicated and useful neural networks
  • Discover how convolutional neural networks (CNNs) revolutionize image classification and analysis
  • Apply recurrent neural networks (RNNs) and long short-term memory (LSTM) to text and other variable-length sequences
  • Master NLP with sequence-to-sequence networks and the Transformer architecture
  • Build applications for natural language translation and image captioning

NVIDIA's invention of the GPU sparked the PC gaming market. The company's pioneering work in accelerated computing--a supercharged form of computing at the intersection of computer graphics, high-performance computing, and AI--is reshaping trillion-dollar industries, such as transportation, healthcare, and manufacturing, and fueling the growth of many others.

Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.



Download the book's code examples:

Download large PDF versions of the Appendix J Cheat Sheets:
Cheat Sheets (3.7 MB .zip)


Author's Site

Please visit the author's site at ldlbook.com, and his company page at nvidia.com/dli-books.

Sample Content

Online Sample Chapter

Deep Learning Frameworks and Network Tweaks

Sample Pages

Download the sample pages (includes Chapter 5

Table of Contents

Foreword by Dr. Anima Anandkumar xxi
Foreword by Dr. Craig Clawson xxiii
Preface xxv
Acknowledgments li
About the Author liii

Chapter 1: The Rosenblatt Perceptron 1
Example of a Two-Input Perceptron 4
The Perceptron Learning Algorithm 7
Limitations of the Perceptron 15
Combining Multiple Perceptrons 17
Implementing Perceptrons with Linear Algebra 20
Geometric Interpretation of the Perceptron 30
Understanding the Bias Term 33
Concluding Remarks on the Perceptron 34

Chapter 2: Gradient-Based Learning 37
Intuitive Explanation of the Perceptron Learning Algorithm 37
Derivatives and Optimization Problems 41
Solving a Learning Problem with Gradient Descent 44
Constants and Variables in a Network 48
Analytic Explanation of the Perceptron Learning Algorithm 49
Geometric Description of the Perceptron Learning Algorithm 51
Revisiting Different Types of Perceptron Plots 52
Using a Perceptron to Identify Patterns 54
Concluding Remarks on Gradient-Based Learning 57

Chapter 3: Sigmoid Neurons and Backpropagation 59
Modified Neurons to Enable Gradient Descent for Multilevel Networks 60
Which Activation Function Should We Use? 66
Function Composition and the Chain Rule 67
Using Backpropagation to Compute the Gradient 69
Backpropagation with Multiple Neurons per Layer 81
Programming Example: Learning the XOR Function 82
Network Architectures 87
Concluding Remarks on Backpropagation 89

Chapter 4: Fully Connected Networks Applied to Multiclass Classification 91
Introduction to Datasets Used When Training Networks 92
Training and Inference 100
Extending the Network and Learning Algorithm to Do Multiclass Classification 101
Network for Digit Classification 102
Loss Function for Multiclass Classification 103
Programming Example: Classifying Handwritten Digits 104
Mini-Batch Gradient Descent 114
Concluding Remarks on Multiclass Classification 115

Chapter 5: Toward DL: Frameworks and Network Tweaks 117
Programming Example: Moving to a DL Framework 118
The Problem of Saturated Neurons and Vanishing Gradients 124
Initialization and Normalization Techniques to Avoid Saturated Neurons 126
Cross-Entropy Loss Function to Mitigate Effect of Saturated Output Neurons 130
Different Activation Functions to Avoid Vanishing Gradient in Hidden Layers 136
Variations on Gradient Descent to Improve Learning 141
Experiment: Tweaking Network and Learning Parameters 143
Hyperparameter Tuning and Cross-Validation 146
Concluding Remarks on the Path Toward Deep Learning 150

Chapter 6: Fully Connected Networks Applied to Regression 153
Output Units 154
The Boston Housing Dataset 160
Programming Example: Predicting House Prices with a DNN 161
Improving Generalization with Regularization 166
Experiment: Deeper and Regularized Models for House Price Prediction 169
Concluding Remarks on Output Units and Regression Problems 170

Chapter 7: Convolutional Neural Networks Applied to Image Classification 171
The CIFAR-10 Dataset 173
Characteristics and Building Blocks for Convolutional Layers 175
Combining Feature Maps into a Convolutional Layer 180
Combining Convolutional and Fully Connected Layers into a Network 181
Effects of Sparse Connections and Weight Sharing 185
Programming Example: Image Classification with a Convolutional Network 190
Concluding Remarks on Convolutional Networks 201

Chapter 8: Deeper CNNs and Pretrained Models 205
VGGNet 206
GoogLeNet 210
ResNet 215
Programming Example: Use a Pretrained ResNet Implementation 223
Transfer Learning 226
Backpropagation for CNN and Pooling 228
Data Augmentation as a Regularization Technique 229
Mistakes Made by CNNs 231
Reducing Parameters with Depthwise Separable Convolutions 232
Striking the Right Network Design Balance with EfficientNet 234
Concluding Remarks on Deeper CNNs 235

Chapter 9: Predicting Time Sequences with Recurrent Neural Networks 237
Limitations of Feedforward Networks 241
Recurrent Neural Networks 242
Mathematical Representation of a Recurrent Layer 243
Combining Layers into an RNN 245
Alternative View of RNN and Unrolling in Time 246
Backpropagation Through Time 248
Programming Example: Forecasting Book Sales 250
Dataset Considerations for RNNs 264
Concluding Remarks on RNNs 265

Chapter 10: Long Short-Term Memory 267
Keeping Gradients Healthy 267
Introduction to LSTM 272
LSTM Activation Functions 277
Creating a Network of LSTM Cells 278
Alternative View of LSTM 280
Related Topics: Highway Networks and Skip Connections 282
Concluding Remarks on LSTM 282

Chapter 11: Text Autocompletion with LSTM and Beam Search 285
Encoding Text 285
Longer-Term Prediction and Autoregressive Models 287
Beam Search 289
Programming Example: Using LSTM for Text Autocompletion 291
Bidirectional RNNs 298
Different Combinations of Input and Output Sequences 300
Concluding Remarks on Text Autocompletion with LSTM 302

Chapter 12: Neural Language Models and Word Embeddings 303
Introduction to Language Models and Their Use Cases 304
Examples of Different Language Models 307
Benefit of Word Embeddings and Insight into How They Work 313
Word Embeddings Created by Neural Language Models 315
Programming Example: Neural Language Model and Resulting Embeddings 319
King Man + Woman! = Queen 329
King Man + Woman ! = Queen 331
Language Models, Word Embeddings, and Human Biases 332
Related Topic: Sentiment Analysis of Text 334
Concluding Remarks on Language Models and Word Embeddings 342

Chapter 13: Word Embeddings from word2vec and GloVe 343
Using word2vec to Create Word Embeddings Without a Language Model 344
Additional Thoughts on word2vec 352
word2vec in Matrix Form 353
Wrapping Up word2vec 354
Programming Example: Exploring Properties of GloVe Embeddings 356
Concluding Remarks on word2vec and GloVe 361

Chapter 14: Sequence-to-Sequence Networks and Natural Language Translation 363
Encoder-Decoder Model for Sequence-to-Sequence Learning 366
Introduction to the Keras Functional API 368
Programming Example: Neural Machine Translation 371
Experimental Results 387
Properties of the Intermediate Representation 389
Concluding Remarks on Language Translation 391

Chapter 15: Attention and the Transformer 393
Rationale Behind Attention 394
Attention in Sequence-to-Sequence Networks 395
Alternatives to Recurrent Networks 406
Self-Attention 407
Multi-head Attention 410
The Transformer 411
Concluding Remarks on the Transformer 415

Chapter 16: One-to-Many Network for Image Captioning 417
Extending the Image Captioning Network with Attention 420
Programming Example: Attention-Based Image Captioning 421
Concluding Remarks on Image Captioning 443

Chapter 17: Medley of Additional Topics 447
Autoencoders 448
Multimodal Learning 459
Multitask Learning 469
Process for Tuning a Network 477
Neural Architecture Search 482
Concluding Remarks 502

Chapter 18: Summary and Next Steps 503
Things You Should Know by Now 503
Ethical AI and Data Ethics 505
Things You Do Not Yet Know 512
Next Steps 516

Appendix A: Linear Regression and Linear Classifiers 519
Linear Regression as a Machine Learning Algorithm 519
Computing Linear Regression Coefficients 523
Classification with Logistic Regression 525
Classifying XOR with a Linear Classifier 528
Classification with Support Vector Machines 531
Evaluation Metrics for a Binary Classifier 533

Appendix B: Object Detection and Segmentation 539
Object Detection 540
Semantic Segmentation 549
Instance Segmentation with Mask R-CNN 559

Appendix C: Word Embeddings Beyond word2vec and GloVe 563
Wordpieces 564
FastText 566
Character-Based Method 567
ELMo 572
Related Work 575

Appendix D: GPT, BERT, AND RoBERTa 577
GPT 578
BERT 582
RoBERTa 586
Historical Work Leading Up to GPT and BERT 588
Other Models Based on the Transformer 590

Appendix E: Newton-Raphson versus Gradient Descent 593
Newton-Raphson Root-Finding Method 594
Relationship Between Newton-Raphson and Gradient Descent 597

Appendix F: Matrix Implementation of Digit Classification Network 599
Single Matrix 599
Mini-Batch Implementation 602

Appendix G: Relating Convolutional Layers to Mathematical Convolution 607

Appendix H: Gated Recurrent Units 613

Alternative GRU Implementation 616
Network Based on the GRU 616

Appendix I: Setting up a Development Environment 621
Python 622
Programming Environment 623
Programming Examples 624
Datasets 625
Installing a DL Framework 628
TensorFlow Specific Considerations 630
Key Differences Between PyTorch and TensorFlow 631

Appendix J: Cheat Sheets 637

Works Cited 647
Index 667


Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020