Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Enhancing Deep Learning with Bayesian Inference
Enhancing Deep Learning with Bayesian Inference

Enhancing Deep Learning with Bayesian Inference: Create more powerful, robust deep learning systems with Bayesian deep learning in Python

By Matt Benatan , Jochem Gietema , Marian Schneider
$15.99 per month
Book Jun 2023 386 pages 1st Edition
eBook
$49.99 $34.98
Print
$59.99
Subscription
$15.99 Monthly
eBook
$49.99 $34.98
Print
$59.99
Subscription
$15.99 Monthly

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Enhancing Deep Learning with Bayesian Inference

Chapter 1
Bayesian Inference in the Age of Deep Learning

Over the last fifteen years, machine learning (ML) has gone from a relatively little-known field to a buzzword in the tech community. This is due in no small part to the impressive feats of neural networks (NNs). Once a niche underdog in the field, deep learning’s accomplishments in almost every conceivable application have resulted in a near-meteoric rise in its popularity. Its success has been so pervasive that, rather than being impressed by features afforded by deep learning, we’ve come to expect them. From applying filters in social networking apps, through to relying on Google Translate when on vacation abroad, it’s undeniable that deep learning is now well and truly embedded in the technology landscape.

But, despite all of its impressive accomplishments, and the variety of products and features it’s afforded us, deep learning has not yet surmounted its final hurdle. As sophisticated neural...

1.1 Technical requirements

All of the code for this book can be found on the GitHub repository for the book: https://github.com/PacktPublishing/Enhancing-Deep-Learning-with-Bayesian-Inference.

1.2 Wonders of the deep learning age

Over the last 10 to 15 years, we’ve seen a dramatic shift in the landscape of ML thanks to the enormous success of deep learning. Perhaps one of the most impressive feats of the universal impact of deep learning is that it has affected fields from medical imaging and manufacturing all the way through to tools for translation and content creation.

While deep learning has only seen great success over recent years, many of its core principles are already well established. Researchers have been working with neural networks for some time – in fact, one could argue that the first neural network was introduced by Frank Rosenblatt as early as 1957! This, of course, wasn’t as sophisticated as the models we have today, but it was an important component of these models: the perceptron, as shown in Figure 1.1.

PIC

Figure 1.1: Diagram of a single perceptron

The 1980s saw the introduction of many now-familiar concepts, with the introduction...

1.3 Understanding the limitations of deep learning

As we’ve seen, deep learning has achieved some remarkable feats, and it’s undeniable that it’s revolutionizing the way that we deal with data and predictive modeling. But deep learning’s short history also comprises darker tales: stories that bring with them crucial lessons for developing systems that are more robust, and, crucially, safer.

In this section, we’ll introduce a couple of key cases in which deep learning failed, and we will discuss how a Bayesian perspective could have helped to produce a better outcome.

1.3.1 Bias in deep learning systems

We’ll start with a textbook example of bias, a crucial problem faced by data-driven methods. This example centers around Amazon. Now a household name, the e-commerce company started out by revolutionizing the world of book retail, before becoming literally the one-stop shop for just about anything: from garden furniture to a new laptop, or even...

1.4 Core topics

The aim of this book is to provide you with the tools and knowledge you need to develop your own BDL solutions. To this end, while we assume some familiarity with concepts of statistical learning and deep learning, we will still provide a refresher of these fundamental concepts.

In Chapter 2, Fundamentals of Bayesian Inference, we’ll go over some of the key concepts from Bayesian inference, including probabilities and model uncertainty estimates. In Chapter 3, Fundamentals of Deep Learning, we’ll cover important key aspects of deep learning, including learning via backpropagation, and popular varieties of NNs. With these fundamentals covered, we’ll start to explore BDL in Chapter 4, Introducing Bayesian Deep Learning. In Chapters 5 and 6 we’ll delve deeper into BDL; we’ll first learn about principled methods, before going on to understand more practical methods for approximating Bayesian neural networks.

In Chapter ...

1.5 Setting up the work environment

To complete the practical elements of the book, you’ll need a Python 3.9 environment with the necessary prerequisites. We recommend using conda, a Python package manager specifically designed for scientific computing applications. To install conda, simply head to https://conda.io/projects/conda/en/latest/user-guide/install/index.html and follow the instructions for your operating system.

With conda installed, you can set up the conda environment that you’ll use for the book:

 
conda create -n bdl python=3.9

When you hit Enter to execute this command, you’ll be asked if you wish to continue installing the required packages; simply type y and hit Enter. conda will now proceed to install the core packages.

You can now activate your environment by typing the following:

 
conda activate bdl

You’ll now see that your shell prompt contains bdl, indicating that your conda environment is active. Now you...

1.6 Summary

In this chapter, we’ve revisited the successes of deep learning, renewing our understanding of its enormous potential, and its ubiquity within today’s technology. We’ve also explored some key examples of its shortcomings: scenarios in which deep learning has failed us, demonstrating the potential for catastrophic consequences. While BDL can’t eliminate these risks, it can allow us to build more robust ML systems that incorporate both the flexibility of deep learning and the caution of Bayesian inference.

In the next chapter, we’ll dive deeper into the latter as we cover some of the core concepts of Bayesian inference and probability, in preparation for our foray into BDL.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Gain insights into the limitations of typical neural networks
  • Acquire the skill to cultivate neural networks capable of estimating uncertainty
  • Discover how to leverage uncertainty to develop more robust machine learning systems

Description

Deep learning has an increasingly significant impact on our lives, from suggesting content to playing a key role in mission- and safety-critical applications. As the influence of these algorithms grows, so does the concern for the safety and robustness of the systems which rely on them. Simply put, typical deep learning methods do not know when they don’t know. The field of Bayesian Deep Learning contains a range of methods for approximate Bayesian inference with deep networks. These methods help to improve the robustness of deep learning systems as they tell us how confident they are in their predictions, allowing us to take more in how we incorporate model predictions within our applications. Through this book, you will be introduced to the rapidly growing field of uncertainty-aware deep learning, developing an understanding of the importance of uncertainty estimation in robust machine learning systems. You will learn about a variety of popular Bayesian Deep Learning methods, and how to implement these through practical Python examples covering a range of application scenarios. By the end of the book, you will have a good understanding of Bayesian Deep Learning and its advantages, and you will be able to develop Bayesian Deep Learning models for safer, more robust deep learning systems.

What you will learn

Understand advantages and disadvantages of Bayesian inference and deep learning Understand the fundamentals of Bayesian Neural Networks Understand the differences between key BNN implementations/approximations Understand the advantages of probabilistic DNNs in production contexts How to implement a variety of BDL methods in Python code How to apply BDL methods to real-world problems Understand how to evaluate BDL methods and choose the best method for a given task Learn how to deal with unexpected data in real-world deep learning applications

Product Details

Country selected

Publication date : Jun 30, 2023
Length 386 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781803246888
Category :
Concepts :

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details


Publication date : Jun 30, 2023
Length 386 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781803246888
Category :
Concepts :

Table of Contents

11 Chapters
Preface Chevron down icon Chevron up icon
1. Chapter 1: Bayesian Inference in the Age of Deep Learning Chevron down icon Chevron up icon
2. Chapter 2: Fundamentals of Bayesian Inference Chevron down icon Chevron up icon
3. Chapter 3: Fundamentals of Deep Learning Chevron down icon Chevron up icon
4. Chapter 4: Introducing Bayesian Deep Learning Chevron down icon Chevron up icon
5. Chapter 5: Principled Approaches for Bayesian Deep Learning Chevron down icon Chevron up icon
6. Chapter 6: Using the Standard Toolbox for Bayesian Deep Learning Chevron down icon Chevron up icon
7. Chapter 7: Practical Considerations for Bayesian Deep Learning Chevron down icon Chevron up icon
8. Chapter 8: Applying Bayesian Deep Learning Chevron down icon Chevron up icon
9. Chapter 9: Next Steps in Bayesian Deep Learning Chevron down icon Chevron up icon
10. Why subscribe? Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Top Reviews
No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.