Search icon
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

You're reading from  Enhancing Deep Learning with Bayesian Inference

Product type Book
Published in Jun 2023
Publisher Packt
ISBN-13 9781803246888
Pages 386 pages
Edition 1st Edition
Languages
Authors (3):
Matt Benatan Matt Benatan
Profile icon Matt Benatan
Jochem Gietema Jochem Gietema
Profile icon Jochem Gietema
Marian Schneider Marian Schneider
Profile icon Marian Schneider
View More author details

Table of Contents (11) Chapters

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

7.3 BDL and sources of uncertainty

In this case study, we will look at how we can model aleatoric and epistemic uncertainty in a regression problem when we are trying to predict a continuous outcome variable. We will use a real-life dataset of diamonds that contains the physical attributes of more than 50,000 diamonds as well as their prices. In particular, we will look at the relationship between the weight of a diamond (measured as its carat) and the price paid for the diamond.

Step 1: Setting up the environment

To set up the environment, we import several packages. We import tensorflow and tensorflow_probability for building and training vanilla and probabilistic neural networks, tensorflow_datasets for importing the diamonds data set, numpy for performing calculations and operations on numerical arrays (such as calculating the mean), pandas for handling DataFrames, and matplotlib for plotting:

 
import matplotlib.pyplot as plt  
import numpy as np ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}