Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Hands-On One-shot Learning with Python
Hands-On One-shot Learning with Python

Hands-On One-shot Learning with Python: Learn to implement fast and accurate deep learning models with fewer training samples using PyTorch

Arrow left icon
Profile Icon Shruti Jadon Profile Icon Ankush Garg
Arrow right icon
Can$42.29 Can$46.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (7 Ratings)
eBook Apr 2020 156 pages 1st Edition
eBook
Can$42.29 Can$46.99
Paperback
Can$58.99
eBook + Subscription
Free Trial
Arrow left icon
Profile Icon Shruti Jadon Profile Icon Ankush Garg
Arrow right icon
Can$42.29 Can$46.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (7 Ratings)
eBook Apr 2020 156 pages 1st Edition
eBook
Can$42.29 Can$46.99
Paperback
Can$58.99
eBook + Subscription
Free Trial
eBook
Can$42.29 Can$46.99
Paperback
Can$58.99
eBook + Subscription
Free Trial

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
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Hands-On One-shot Learning with Python

Introduction to One-shot Learning

Humans can learn new things with a small set of examples. When presented with stimuli, humans seem to be able to understand new concepts quickly and then recognize variations of those concepts in the future. A child can learn to recognize a dog from a single picture, but a machine learning system needs a lot of examples to learn the features of a dog and recognize them in the future. Machine learning, as a field, has been highly successful at a variety of tasks, such as classification and web searching, as well as image and speech recognition. Often, however, these models do not perform well without a large amount of data (examples) to learn from. The primary motivation behind this book is to train a model with very few examples that is capable of generalizing to unfamiliar categories without extensive retraining.

Deep learning has played an important role in the advancement of machine learning, but it also requires large datasets. Different techniques, such as regularization, can reduce overfitting in low-data regimes, but do not solve the inherent problem that comes with fewer training examples. Furthermore, the large size of datasets leads to slow learning, requiring many weight updates using gradient descent. This is mostly due to the parametric aspect of an ML algorithm, in which training examples need to be slowly learned. In contrast, many known non-parametric models such as nearest neighbor do not require any training, but performance depends on a sometimes arbitrarily chosen distance metric such as the L2 distance. One-shot learning is an object categorization problem in computer vision. While most ML-based object categorization algorithms require hundreds or thousands of images and very large datasets to train on, one-shot learning aims to learn information about object categories from one, or only a few, training images. In this chapter, we will learn about the basics of one-shot learning and explore its real-world applications.

The following topics will be covered in this chapter:

  • The human brain—overview
  • Machine learning—history overview
  • One-shot learning—overview
  • Setting up your environment
  • Coding exercise

Technical requirements

The human brain – overview

The human brain has been a subject of research since the beginning of civilization. If we look into the development of a child, we will observe that as they grow, their ability to learn also grows. First, they learn about food, then they learn to identify faces. Every time a child learns something, information is encoded into some portion of the brain. Still, the real question remains, how does information get stored in our brains? Why is some information hardcoded, yet other information is easily forgotten?

How the human brain learns

Most of the information on how the brain trains itself to process data is unknown, but there are various theories that explore it. If we look into the structure of a brain's neuron, as shown in the following diagram, a neuron works similar to a collector, wherein it collects signals from other neurons through dendrites. Once the signal becomes strong, the neuron sends out an electrical signal through thin strands known as axons to nearby neurons. At the end of this network, the synapse converts the signal activity into an excitation activity and activates the connected neurons. Brain neurons learn to send signals to different parts of the brain by changing the effectiveness of the synapse, similar to how some weights become close to zero for certain neurons in an artificial neural network:

There are a lot of theories to suggest that dense connections among neurons increase the ability of humans to learn. In turn, many neuroscientists believe that dense dendrite connectivity is created as the brain is used more through learning and stimulation. Hence, we become more intelligent as we learn more and more.

Comparing human neurons and artificial neurons

Though the human neuron has been the inspiration for creating artificial neural networks, there are several ways in which they are dissimilar. Researchers are trying to bridge these gaps by experimenting with different activation (excitation) functions and non-linear systems. Similar to how our brain has a collection of neurons that transmit and process the information received from our senses, a neural network also consists of layers (a group of neurons) that learns about tasks by transmitting information across layers. In certain cases, we can say an artificial neuron works in a similar way to a neuron present in our brain. Let's look at the following diagram:

As we can see in the preceding diagram, information flows through each connection, and each connection has a specific weight, which controls the flow of data. If we compare a human brain neuron's activity with artificial neural networks, we will see that whenever we create a neural network for a task, it is like creating a new brain neuron. If we look around us, we have already started relying on computers to make decisions, for example, in the case of credit card fraud, spam/non-spam emails, and recommendation systems. It's like we have created new brains for small tasks around us. Still, the question remains, what is the difference between human and artificial neural networks? Let's find out:

  • One of the major differences is the amount of learning data required. For a neural network to learn, we need a lot of data, whereas a human brain can learn with less data. If we wish to have a neural network with a similar capacity to a human brain, we need to improve upon existing optimization algorithms.
  • Another key difference is speed. Often, neural networks process data and information much more quickly than humans.

Machine learning – historical overview

Machine learning is a program that, given a task (loss function), learns through experience (training data). With experience, that program learns to perform the given task to a desirable standard. During the 1960s, machine learning was majorly focused on creating different forms of data preprocessing filters. With the introduction of image filters, the focus then shifted toward computer vision, and major research work was undertaken in this domain during the 1990s and 2000s. After some stability in terms of traditional machine learning algorithms being developed, researchers moved to the probabilistic domain, as it became more promising with the introduction of high-dimensional data. Deep learning bloomed when it won the ImageNet Challenge in 2012, and has since taken on an important role in the field of data science.

Machine learning can be classified into two categories:

  • Parametric: Learning is accomplished by using an algorithm to adapt the parameters in a mathematical or statistical model given training data, such as logistic regression, support vector machines, and neural networks.
  • Nonparametric: Learning is accomplished by storing the training data (memorization) and performing some dimensionality reduction mappings, for example, k-nearest neighbor (kNN) and decision trees.
Due to the requirement of learning parameters, the parametric approach usually requires a large amount of data. Incidentally, if we have a large number of datasets, it's best to use a parametric approach, as a nonparametric approach generally requires storing data and processing it for every query.

Challenges in machine learning and deep learning

Machine learning and deep learning have revolutionized the computer science industry, but they have advantages and disadvantages. Some of the common challenges faced by our current approaches are as follows:

  • Data gathering: Collecting sufficient relevant data for each category for machines to learn is laborious.
  • Data labeling: Often, labeling data requires experts or is impossible due to privacy, safety, or ethical issues.
  • Hardware constraints: Due to the large amount of data, as well as large parametric models, expensive hardware (GPUs and TPUs) is required to train them.
  • Result analysis: Understanding the result is also a major challenge, though there are certain open source libraries that provide analysis parameters.

Apart from these challenges, machine learning also faces challenges in dealing with feature selection and higher-dimensional data.

In the next section, we will introduce one-shot learning and learn how it attempts to solve the challenges faced by machine learning and deep learning.

One-shot learning – overview

One-shot learning can be seen as an approach to train machines in a way that is similar to how humans learn. One-shot learning is an approach to learn a new task using limited supervised data with the help of strong prior knowledge. The first work published that resulted in high accuracy for the image classification problem dates back to the 2000s by Dr. Fei Fei Li—although, in recent years, researchers have made good progress tackling it through different deep learning architectures and optimization algorithms, such as matching networks, model agnostic meta-learning, and memory-augmented neural networks. One-shot learning has a lot of applications in several industriesthe medical and manufacturing industries in particular. In medicine, we can use one-shot learning when there is limited data available, for example, when working with rare diseases; whereas in manufacturing, we can reduce man-made errors such as edge case manufacturing defects.

Prerequisites of one-shot learning

If we look into further discussion about how we can learn necessary information from a limited amount of data, we will realize that the human brain already has neurons trained to extract important information. For example, if a child has been taught that a spherical object is a ball, their brain also processes information about the ball's size and texturealso known as filters of the object. So, for any form of one-shot learning, we can say we need at least one of the following things:

  • Previously trained filters and a pre-determined architecture
  • A correct assumption of data distribution
  • A definite form of taxonomy for information stored or collected

In certain cases, we observe that we can only have a very low level of feature extraction. In those scenarios, we can just rely on a nonparametric or probabilistic approach because, to learn parameters, we need a sufficient amount of data. Even if we somehow force a neural network to learn with hardly any data, it will result in overfitting.

In the next section, we will do a short coding exercise to see how, when we have a small dataset, a simple nonparametric kNN performs better than neural networks. Unfortunately, it probably wouldn't work very well in the real world, as we still have the problems of learning a good feature representation and choosing an appropriate distance function.

Types of one-shot learning

There are various approaches to solve one-shot learning. Roughly speaking, they can be organized into five main categories:

  • Data augmentation methods
  • Model-based methods
  • Metrics-based methods
  • Optimization-based methods
  • Generative modeling-based methods

The following diagram shows the categories of one-shot learning:

Data augmentation is the most commonly used method in the deep learning community to add variations to data, increase data size, and balance data. It's achieved by adding some form of noise in the data. For instance, images might be scaled, translated, and rotated; whereas in a natural language processing task, there might be synonym replacement, random insertions, and random swaps.

Though data augmentation methods play a crucial role in preprocessing, we won't be covering that topic in this book. In this book, we will focus on algorithmic approaches of one-shot learning and how to implement them. We will also experiment with them on commonly used one-shot learning datasets such as the Omniglot dataset and Mini ImageNet.

Setting up your environment

In this section, we will set up a virtual environment for our coding exercise and questions using the following steps:

  1. Clone the repository by going into the directory of your choice and running the following command in the Git Bash command line:
git clone https://github.com/Packt-Publishing/Hands-on-One-Shot-Learning.git
  1. Go to the Chapter01 directory of the cloned repository:
cd Hands-on-One-Shot-Learning/Chapter01
  1. Then, open a Terminal and use the following command to install Anaconda for Python, version 3.6 (https://docs.anaconda.com/anaconda/install/), and create a virtual environment:
conda create --name environment_name python=3.6
In steps 3 and 4, you can replace environment_name with an easy name to remember, such as one_shot, or a name of your choice.
  1. Activate the environment using the following command:
source activate environment_name
  1. Install requirements.txt using the following command:
pip install -r requirements.txt
  1. Run the following command to open Jupyter Notebook:
jupyter notebook

Now that we have set up the environment, let's go ahead with the coding exercise.

Coding exercise

In this section, we will explore a basic one-shot learning approach. As humans, we have a hierarchical way of thinking. For example, if we see something unknown to us, we look for its similarity to objects we already know. Similarly, in this exercise, we will use a nonparametric kNN approach to find classes. We will also compare its performance to the basic neural network architecture.

kNN – basic one-shot learning

In this exercise, we will compare kNN to neural networks where we have a small dataset. We will be using the iris dataset imported from the scikit-learn library.

To begin, we will first discuss the basics of kNN. The kNN classifier is a nonparametric classifier that simply stores the training data, D, and classifies each new instance using a majority vote over its set of k nearest neighbors, computed using any distance function. For a kNN, we need to choose the distance function, d, and the number of neighbors, k:

Follow these steps to compare kNN with a neural network:

  1. Import all the libraries required for this exercise using the following code:
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix, accuracy_score
from sklearn.model_selection import cross_val_score
from sklearn.neural_network import MLPClassifier
  1. Import the iris dataset:
# import small dataset
iris = datasets.load_iris()
X = iris.data
y = iris.target
  1. To ensure we are using a very small dataset, we will randomly choose 30 points and print them using the following code:
indices=np.random.choice(len(X), 30)
X=X[indices]
y=y[indices]
print (y)

This will be the resultant output:

[2 1 2 1 2 0 1 0 0 0 2 1 1 0 0 0 2 2 1 2 1 0 0 1 2 0 0 2 0 0]
  1. To understand our features, we will try to plot them in 3D as a scatterplot:
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure(1, figsize=(20, 15))
ax = Axes3D(fig, elev=48, azim=134)
ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=y,
         cmap=plt.cm.Set1, edgecolor='k', s = X[:, 3]*50)

for name, label in [('Virginica', 0), ('Setosa', 1), ('Versicolour', 2)]:
    ax.text3D(X[y == label, 0].mean(),
              X[y == label, 1].mean(),
              X[y == label, 2].mean(), name,
              horizontalalignment='center',
              bbox=dict(alpha=.5, edgecolor='w', facecolor='w'),size=25)

ax.set_title("3D visualization", fontsize=40)
ax.set_xlabel("Sepal Length [cm]", fontsize=25)
ax.w_xaxis.set_ticklabels([])
ax.set_ylabel("Sepal Width [cm]", fontsize=25)
ax.w_yaxis.set_ticklabels([])
ax.set_zlabel("Petal Length [cm]", fontsize=25)
ax.w_zaxis.set_ticklabels([])

plt.show()

The following plot is the output. As we can see in the 3D visualization, data points are usually found in groups:

  1. To begin with, we will first split the dataset into training and testing sets using an 80:20 split. We will be using k=3 as the nearest neighbor:
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
# Instantiate learning model (k = 3)
classifier = KNeighborsClassifier(n_neighbors=3)

# Fitting the model
classifier.fit(X_train, y_train)

# Predicting the Test set results
y_pred = classifier.predict(X_test)

cm = confusion_matrix(y_test, y_pred)

accuracy = accuracy_score(y_test, y_pred)*100 print('Accuracy of our model is equal ' + str(round(accuracy, 2)) + ' %.')

This will result in the following output:

Accuracy of our model is equal 83.33 %.
  1. Initialize the hidden layers' sizes and the number of iterations:
mlp = MLPClassifier(hidden_layer_sizes=(13,13,13),max_iter=10)
mlp.fit(X_train,y_train)
You might get some warnings, depending on the version of scikit-learn, such as /sklearn/neural_network/multilayer_perceptron.py:562:ConvergenceWarning: Stochastic Optimizer: Maximum iterations (10) reached and the optimization hasn't converged yet. % self.max_iter, ConvergenceWarning). It's just an indication that your model isn't converged yet.
  1. We will predict our test dataset for both kNN and a neural network and then compare the two:
predictions = mlp.predict(X_test)

accuracy = accuracy_score(y_test, predictions)*100 print('Accuracy of our model is equal ' + str(round(accuracy, 2)) + ' %.')

The following is the resultant output:

Accuracy of our model is equal 50.0 %.

For our current scenario, we can see that the neural network is less accurate than the kNN. This could be due to a lot of reasons, including the randomness of the dataset, the choice of neighbors, and the number of layers. But if we run it enough times, we will observe that a kNN is more likely to give a better output as it always stores data points, instead of learning parameters as neural networks do. Therefore, a kNN can be called a one-shot learning method.

Summary

Deep learning has revolutionized the field of data science and it is still making progress, but there are still major industries that are yet to experience all of the advantages of deep learning, such as the medical and manufacturing industries. The zenith of human achievement will be to create a machine that can learn as humans do and that can become an expert in the same way humans can. Successful deep learning, though, usually comes with the prerequisite of having very large datasets to work from. Fortunately, this book focuses on architectures that can do away with this prerequisite.

In this chapter, we learned about the human brain and how the structure of an artificial neural network is close to the structure of our brain. We introduced the basic concepts of machine learning and deep learning, along with their challenges. We also discussed one-shot learning and its various types, and later experimented with the iris dataset to compare a parametric and nonparametric approach in a scarce data situation. Overall, we concluded that proper feature representation plays an important role in determining the efficiency of a machine learning model.

In the next chapter, we will learn about metrics-based one-shot learning methods and explore the feature extraction domain of one-shot learning algorithms.

Questions

  • Why does a kNN work better than a newly trained artificial neural network for a one-shot learning task?
  • What are nonparametric machine learning algorithms?
  • Are decision trees a parametric or nonparametric algorithm?
  • Experiment with other classification algorithms as a coding exercise and compare the results.
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn how you can speed up the deep learning process with one-shot learning
  • Use Python and PyTorch to build state-of-the-art one-shot learning models
  • Explore architectures such as Siamese networks, memory-augmented neural networks, model-agnostic meta-learning, and discriminative k-shot learning

Description

One-shot learning has been an active field of research for scientists trying to develop a cognitive machine that mimics human learning. With this book, you'll explore key approaches to one-shot learning, such as metrics-based, model-based, and optimization-based techniques, all with the help of practical examples. Hands-On One-shot Learning with Python will guide you through the exploration and design of deep learning models that can obtain information about an object from one or just a few training samples. The book begins with an overview of deep learning and one-shot learning and then introduces you to the different methods you can use to achieve it, such as deep learning architectures and probabilistic models. Once you've got to grips with the core principles, you'll explore real-world examples and implementations of one-shot learning using PyTorch 1.x on datasets such as Omniglot and MiniImageNet. Finally, you'll explore generative modeling-based methods and discover the key considerations for building systems that exhibit human-level intelligence. By the end of this book, you'll be well-versed with the different one- and few-shot learning methods and be able to use them to build your own deep learning models.

Who is this book for?

If you're an AI researcher or a machine learning or deep learning expert looking to explore one-shot learning, this book is for you. It will help you get started with implementing various one-shot techniques to train models faster. Some Python programming experience is necessary to understand the concepts covered in this book.

What you will learn

  • Get to grips with the fundamental concepts of one- and few-shot learning
  • Work with different deep learning architectures for one-shot learning
  • Understand when to use one-shot and transfer learning, respectively
  • Study the Bayesian network approach for one-shot learning
  • Implement one-shot learning approaches based on metrics, models, and optimization in PyTorch
  • Discover different optimization algorithms that help to improve accuracy even with smaller volumes of data
  • Explore various one-shot learning architectures based on classification and regression

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 10, 2020
Length: 156 pages
Edition : 1st
Language : English
ISBN-13 : 9781838824877
Category :
Languages :
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
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 10, 2020
Length: 156 pages
Edition : 1st
Language : English
ISBN-13 : 9781838824877
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.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
$199.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 Can$6 each
Feature tick icon Exclusive print discounts
$279.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 Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 205.97
Artificial Intelligence with Python Cookbook
Can$58.99
Modern Computer Vision with PyTorch
Can$87.99
Hands-On One-shot Learning with Python
Can$58.99
Total Can$ 205.97 Stars icon

Table of Contents

10 Chapters
Section 1: One-shot Learning Introduction Chevron down icon Chevron up icon
Introduction to One-shot Learning Chevron down icon Chevron up icon
Section 2: Deep Learning Architectures Chevron down icon Chevron up icon
Metrics-Based Methods Chevron down icon Chevron up icon
Model-Based Methods Chevron down icon Chevron up icon
Optimization-Based Methods Chevron down icon Chevron up icon
Section 3: Other Methods and Conclusion Chevron down icon Chevron up icon
Generative Modeling-Based Methods Chevron down icon Chevron up icon
Conclusions and Other Approaches Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(7 Ratings)
5 star 71.4%
4 star 0%
3 star 0%
2 star 14.3%
1 star 14.3%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Jul 01, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book summarizes all major few-shot learning papers. The authors have done a good job making this an engaging read irrespective of your experience in the subject. Great book to start, if you are new to this field.
Amazon Verified review Amazon
Anubhav May 17, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I got this book directly from Packt website and not from amazon.I'm a recent grduate with MS in Machine Learning.This book is a great starting point to jump into few-shot learning research.It gives a brief introduction to recent Deep Neural Networks architectures. Then it takes a deep dive into recent few shot learning methodologies.The pytorch sample code makes it very easy to pickup the concepts and writte actual code.
Amazon Verified review Amazon
M Jun 30, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good book to start learning about few-shot learning. Have been through few-chapters, the concepts are explained well. It also have a code repo, which has been very helpful.
Amazon Verified review Amazon
ConfusedSoul Jun 30, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is an excellent book to get started with the area of One-Shot learning. My favorite part of the book was the lucid explanation of concepts backed by code snippets. What's also nice is that a lot of thought has been put into the organization of the book's contents itself so a person new to the area of one and few-shot learning isn't overwhelmed. Highly recommend!
Amazon Verified review Amazon
doodla Jun 25, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a pretty good introduction to One shot learning. I'm still halfway through this, but the concepts are explained clearly and there are a lot of examples. I think the authors did a good job with the do-it-yourself problems, which are quite engaging.
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.

Modal Close icon
Modal Close icon