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
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Hands-On Meta Learning with Python
Hands-On Meta Learning with Python

Hands-On Meta Learning with Python: Meta learning using one-shot learning, MAML, Reptile, and Meta-SGD with TensorFlow

Arrow left icon
Profile Icon Sudharsan Ravichandiran
Arrow right icon
€8.99 €26.99
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.5 (6 Ratings)
eBook Dec 2018 226 pages 1st Edition
eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Sudharsan Ravichandiran
Arrow right icon
€8.99 €26.99
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.5 (6 Ratings)
eBook Dec 2018 226 pages 1st Edition
eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.99 €26.99
Paperback
€32.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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

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

Hands-On Meta Learning with Python

Face and Audio Recognition Using Siamese Networks

In the last chapter, we learned about what meta learning is and different types of meta learning techniques. We also saw how to learn gradient descent by gradient descent and optimization as a model for few-shot learning. In this chapter, we will learn one of the most commonly used metric-based one-shot learning algorithms called siamese networks. We will see how siamese networks learn from very few data points and how they are used to solve the low data problem. After that we will explore the architecture of siamese networks in detail and we will see some of the applications of siamese networks. At the end of this chapter, we will learn how to build face and audio recognition models using siamese networks.

In this chapter, you will learn the following:

  • What are siamese networks?
  • Architecture of siamese networks
  • Applications of...

What are siamese networks?

A siamese network is a special type of neural network and it is one of the simplest and most popularly used one-shot learning algorithms. As we have learned in the previous chapter, one-shot learning is a technique where we learn from only one training example per class. So, a siamese network is predominantly used in applications where we don't have many data points in each class. For instance, let's say we want to build a face recognition model for our organization and about 500 people are working in our organization. If we want to build our face recognition model using a Convolutional Neural Network (CNN) from scratch, then we need many images of all of these 500 people for training the network and attaining good accuracy. But apparently, we will not have many images for all of these 500 people and so it is not feasible to build a model using...

Face recognition using siamese networks

We will understand the siamese network by building a face recognition model. The objective of our network is to understand whether two faces are similar or dissimilar. We use the AT&T Database of Faces, which can be downloaded from here: https://www.cl.cam.ac.uk/research/dtg/attarchive/facedatabase.html.

Once you have downloaded and extracted the archive, you can see the folders s1, s2, up to s40, as shown here:

Each of these folders has 10 different images of a single person taken from various angles. For instance, let's open folder s1. As you can see, there are 10 different images of a single person:

We open and check folder s13:

As we know that siamese networks require input values as a pair along with the label, we have to create our data in such a way. So, we will take two images randomly from the same folder and mark...

Building an audio recognition model using siamese networks

In the last tutorial, we saw how to use siamese networks to recognize a face. Now we will see how to use siamese networks to recognize audio. We will train our network to differentiate between the sound of a dog and the sound of a cat. The dataset of cat and dog audio can be downloaded from here: https://www.kaggle.com/mmoreaux/audio-cats-and-dogs#cats_dogs.zip.

Once we have downloaded the data, we fragment our data into three folders: Dogs, Sub_dogs, and Cats. In Dogs and Sub_dogs, we place the dog's barking audio and in the Cats folder, we place the cat's audio. The objective of our network is to recognize whether the audio is a dog's barking or some different sound. As we know, for a siamese network, we need to feed input as a pair; we select an audio from the Dogs and Sub_dogs folders and mark them as...

Summary

In this chapter, we have learned what siamese networks are and how to build face and audio recognition models using siamese networks. We explored the architecture of siamese networks, which basically consists of two identical neural networks both having the same weights and architecture and the output of these networks is plugged into some energy function to understand the similarity.

In the next chapter, we will learn about prototypical networks and the variants of the same, such as Gaussian prototypical and semi prototypical networks. We will also see how to use prototypical networks for omniglot character set classification.

Questions

  1. What are siamese networks?
  2. What is the contrastive loss function?
  3. What is the energy function?
  4. What is the desired data format for a siamese network?
  5. What are the applications of siamese networks?

Further readings

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand the foundations of meta learning algorithms
  • Explore practical examples to explore various one-shot learning algorithms with its applications in TensorFlow
  • Master state of the art meta learning algorithms like MAML, reptile, meta SGD

Description

Meta learning is an exciting research trend in machine learning, which enables a model to understand the learning process. Unlike other ML paradigms, with meta learning you can learn from small datasets faster. Hands-On Meta Learning with Python starts by explaining the fundamentals of meta learning and helps you understand the concept of learning to learn. You will delve into various one-shot learning algorithms, like siamese, prototypical, relation and memory-augmented networks by implementing them in TensorFlow and Keras. As you make your way through the book, you will dive into state-of-the-art meta learning algorithms such as MAML, Reptile, and CAML. You will then explore how to learn quickly with Meta-SGD and discover how you can perform unsupervised learning using meta learning with CACTUs. In the concluding chapters, you will work through recent trends in meta learning such as adversarial meta learning, task agnostic meta learning, and meta imitation learning. By the end of this book, you will be familiar with state-of-the-art meta learning algorithms and able to enable human-like cognition for your machine learning models.

Who is this book for?

Hands-On Meta Learning with Python is for machine learning enthusiasts, AI researchers, and data scientists who want to explore meta learning as an advanced approach for training machine learning models. Working knowledge of machine learning concepts and Python programming is necessary.

What you will learn

  • Understand the basics of meta learning methods, algorithms, and types
  • Build voice and face recognition models using a siamese network
  • Learn the prototypical network along with its variants
  • Build relation networks and matching networks from scratch
  • Implement MAML and Reptile algorithms from scratch in Python
  • Work through imitation learning and adversarial meta learning
  • Explore task agnostic meta learning and deep meta learning

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 31, 2018
Length: 226 pages
Edition : 1st
Language : English
ISBN-13 : 9781789537024
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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 31, 2018
Length: 226 pages
Edition : 1st
Language : English
ISBN-13 : 9781789537024
Category :
Languages :
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 119.97
Hands-On Machine Learning for Algorithmic Trading
€49.99
Generative Adversarial Networks Cookbook
€36.99
Hands-On Meta Learning with Python
€32.99
Total 119.97 Stars icon
Banner background image

Table of Contents

11 Chapters
Introduction to Meta Learning Chevron down icon Chevron up icon
Face and Audio Recognition Using Siamese Networks Chevron down icon Chevron up icon
Prototypical Networks and Their Variants Chevron down icon Chevron up icon
Relation and Matching Networks Using TensorFlow Chevron down icon Chevron up icon
Memory-Augmented Neural Networks Chevron down icon Chevron up icon
MAML and Its Variants Chevron down icon Chevron up icon
Meta-SGD and Reptile Chevron down icon Chevron up icon
Gradient Agreement as an Optimization Objective Chevron down icon Chevron up icon
Recent Advancements and Next Steps Chevron down icon Chevron up icon
Assessments 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 Half star icon Empty star icon Empty star icon 2.5
(6 Ratings)
5 star 33.3%
4 star 0%
3 star 0%
2 star 16.7%
1 star 50%
Filter icon Filter
Top Reviews

Filter reviews by




Anit Gupta Nov 30, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book is very nice and the explanation is pretty clear and neat. I loved the model agnostic meta learning chapter as the author has broken down such complex topic into very simple explanation.One of the advantages of this book is it covers from the few short learning algorithms to the state of the art MAML algorithms.
Amazon Verified review Amazon
Vishnu Jan 17, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I stumbled upon this book's GitHub repo and bought this book. It's very well written and the algorithms are explained in the simplest way I could ever think of.Must Read for anyone willing to learn Meta-Learning!!!.
Amazon Verified review Amazon
龙猫 Nov 25, 2021
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Some of the theory is fairly good and clear for this book, but the code is an awful mess. There are not clear reasons why the author selected examples for certain examples. The code is also a mix of Python 2 and Python 3, so you need to have both installed. You could convert the code to Python 3, but that could be a lot of work and error prone. One problem with the text of the book is that the author used images for some of the symbols, and they don't render well for the kindle version. It is really hard to read them. I have tried reading on pc and on my phone, but some of the symbols are just impossible to read. There are some small problems with writing style, but those can be overlooked.
Amazon Verified review Amazon
Vishal Jun 15, 2020
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I do not recommend this book for serious readers. Most of his code comes from other's repositories on GitHub.
Amazon Verified review Amazon
Saee Razi Nov 27, 2019
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
The code base does not work when you run it on your own machine, azure notebooks, or on google colab. When you look up errors you see that the writer copied and pasted code from the internet. This book is a ripoff. The writer has no clue what he is doing.
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.