Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
The Applied TensorFlow and Keras Workshop
The Applied TensorFlow and Keras Workshop

The Applied TensorFlow and Keras Workshop: Develop your practical skills by working through a real-world project and build your own Bitcoin price prediction tracker

Arrow left icon
Profile Icon Harveen Singh Chadha Profile Icon Luis Capelo
Arrow right icon
€13.98 €19.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (2 Ratings)
eBook Jul 2020 174 pages 1st Edition
eBook
€13.98 €19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Harveen Singh Chadha Profile Icon Luis Capelo
Arrow right icon
€13.98 €19.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (2 Ratings)
eBook Jul 2020 174 pages 1st Edition
eBook
€13.98 €19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€13.98 €19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

The Applied TensorFlow and Keras Workshop

2. Real-World Deep Learning: Predicting the Price of Bitcoin

Overview

This chapter will help you to prepare data for a deep learning model, choose the right model architecture, use Keras—the default API of TensorFlow 2.0, and make predictions with the trained model. By the end of this chapter, you will have prepared a model to make predictions which we will explore in the upcoming chapters.

Introduction

Building on fundamental concepts from Chapter 1, Introduction to Neural Networks and Deep Learning, let's now move on to a real-world scenario and identify whether we can build a deep learning model that predicts Bitcoin prices.

We will learn the principles of preparing data for a deep learning model, and how to choose the right model architecture. We will use Keras—the default API of TensorFlow 2.0 and make predictions with the trained model. We will conclude this chapter by putting all these components together and building a bare bones, yet complete, first version of a deep learning application.

Deep learning is a field that is undergoing intense research activity. Among other things, researchers are devoted to inventing new neural network architectures that can either tackle new problems or increase the performance of previously implemented architectures.

In this chapter, we will study both old and new architectures. Older architectures have been...

Choosing the Right Model Architecture

Considering the available architecture possibilities, there are two popular architectures that are often used as starting points for several applications: Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs). These are foundational networks and should be considered starting points for most projects.

We also include descriptions of another three networks, due to their relevance in the field: Long Short-Term Memory (LSTM) networks (an RNN variant); Generative Adversarial Networks (GANs); and Deep Reinforcement Learning (DRL). These latter architectures have shown great success in solving contemporary problems, however, they are slightly difficult to use. The next section will cover the use of different types of architecture in different problems.

Convolutional Neural Networks (CNNs)

CNNs have gained notoriety for working with problems that have a grid-like structure. They were originally created to classify images,...

Structuring Your Problem

Compared to researchers, practitioners spend much less time determining which architecture to choose when starting a new deep learning project. Acquiring data that represents a given problem correctly is the most important factor to consider when developing these systems, followed by an understanding of the dataset's inherent biases and limitations. When starting to develop a deep learning system, consider the following questions for reflection:

  • Do I have the right data? This is the hardest challenge when training a deep learning model. First, define your problem with mathematical rules. Use precise definitions and organize the problem into either categories (classification problems) or a continuous scale (regression problems). Now, how can you collect data pertaining to those metrics?
  • Do I have enough data? Typically, deep learning algorithms have shown to perform much better on large datasets than on smaller ones. Knowing how much data is...

Using Keras as a TensorFlow Interface

We are using Keras because it simplifies the TensorFlow interface into general abstractions and, in TensorFlow 2.0, this is the default API in this version. In the backend, the computations are still performed in TensorFlow, but we spend less time worrying about individual components, such as variables and operations, and spend more time building the network as a computational unit. Keras makes it easy to experiment with different architectures and hyperparameters, moving more quickly toward a performant solution.

As of TensorFlow 2.0.0, Keras is now officially distributed with TensorFlow as tf.keras. This suggests that Keras is now tightly integrated with TensorFlow and will likely continue to be developed as an open source tool for a long period of time. Components are an integral part when building models. Let's deep dive into this concept now.

Model Components

As we saw in Chapter 1, Introduction to Neural Networks and Deep Learning...

From Data Preparation to Modeling

This section focuses on the implementation aspects of a deep learning system. We will use the Bitcoin data from the Choosing the Right Model Architecture section, and the Keras knowledge from the preceding section, Using Keras as a TensorFlow Interface, to put both of these components together. This section concludes the chapter by building a system that reads data from a disk and feeds it into a model as a single piece of software.

Training a Neural Network

Neural networks can take long periods of time to train. Many factors affect how long that process may take. Among them, three factors are commonly considered the most important:

  • The network's architecture
  • How many layers and neurons the network has
  • How much data there is to be used in the training process

Other factors may also greatly impact how long a network takes to train, but most of the optimization that a neural network can have when addressing a business...

Summary

In this chapter, we have assembled a complete deep learning system, from data to prediction. The model created in this activity requires a number of improvements before it can be considered useful. However, it serves as a great starting point from which we will continuously improve.

The next chapter will explore techniques for measuring the performance of our model and will continue to make modifications until we reach a model that is both useful and robust.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand the nuances of setting up a deep learning programming environment
  • Gain insights into the common components of a neural network and its essential operations
  • Get to grips with deploying a machine learning model as an interactive web application with Flask

Description

Machine learning gives computers the ability to learn like humans. It is becoming increasingly transformational to businesses in many forms, and a key skill to learn to prepare for the future digital economy. As a beginner, you’ll unlock a world of opportunities by learning the techniques you need to contribute to the domains of machine learning, deep learning, and modern data analysis using the latest cutting-edge tools. The Applied TensorFlow and Keras Workshop begins by showing you how neural networks work. After you’ve understood the basics, you will train a few networks by altering their hyperparameters. To build on your skills, you’ll learn how to select the most appropriate model to solve the problem in hand. While tackling advanced concepts, you’ll discover how to assemble a deep learning system by bringing together all the essential elements necessary for building a basic deep learning system - data, model, and prediction. Finally, you’ll explore ways to evaluate the performance of your model, and improve it using techniques such as model evaluation and hyperparameter optimization. By the end of this book, you'll have learned how to build a Bitcoin app that predicts future prices, and be able to build your own models for other projects.

Who is this book for?

If you are a data scientist or a machine learning and deep learning enthusiast, who is looking to design, train, and deploy TensorFlow and Keras models into real-world applications, then this workshop is for you. Knowledge of computer science and machine learning concepts and experience in analyzing data will help you to understand the topics explained in this book with ease.

What you will learn

  • Familiarize yourself with the components of a neural network
  • Understand the different types of problems that can be solved using neural networks
  • Explore different ways to select the right architecture for your model
  • Make predictions with a trained model using TensorBoard
  • Discover the components of Keras and ways to leverage its features in your model
  • Explore how you can deal with new data by learning ways to retrain your model

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 30, 2020
Length: 174 pages
Edition : 1st
Language : English
ISBN-13 : 9781800204072
Category :
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning

Product Details

Publication date : Jul 30, 2020
Length: 174 pages
Edition : 1st
Language : English
ISBN-13 : 9781800204072
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 87.97
The Applied TensorFlow and Keras Workshop
€24.99
The Deep Learning Workshop
€32.99
The Deep Learning with PyTorch Workshop
€29.99
Total 87.97 Stars icon

Table of Contents

4 Chapters
1. Introduction to Neural Networks and Deep Learning Chevron down icon Chevron up icon
2. Real-World Deep Learning: Predicting the Price of Bitcoin Chevron down icon Chevron up icon
3. Real-World Deep Learning: Evaluating the Bitcoin Model Chevron down icon Chevron up icon
4. Productization Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(2 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Rajeev Oct 01, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I wasn't sure what to expect with this book. Overall I was surprised that it covered so many topics that aren't too common, but very important for practitioners out there. I loved the example projects using Bitcoin, also I loved the TensorBoard sections. The best part for me was the Productization Chapter which features some extremely useful information. Great book, also I should add that it covers the basics of Deep Learning from a theoretical and practical standpoint very well!
Amazon Verified review Amazon
nikesh Jan 15, 2021
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The Applied Tensorflow and Keras Workshop is a simple yet powerful book for both beginner and moderate level readers in Data Science and Artificial Intelligence. The book uses a Bitcoin price prediction project to walk the reader through the basics of neural networks and building, training, and deploying models. This book is a good resource to learn model architecture considerations, their limitations, and the impact on model output. For instance, in one example, the authors compare the output of a fully connected model on the MNIST dataset with that of a convolution neural network. Each section of the book provides a link to the original research. The book also includes code files (python scripts) as well as an interactive lab environment. Areas of improvement: Some parts of the book require more explanation. Without such detail, beginners might find them hard to understand. For instance, 1) CNNs on page 35 and the vanishing gradient problem on page 99 can be explained in more detail. 2) For the bitcoin example in the second chapter, more explanation of the code is required.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.