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
Arrow up icon
GO TO TOP
Hands-On One-shot Learning with Python

You're reading from  Hands-On One-shot Learning with Python

Product type Book
Published in Apr 2020
Publisher Packt
ISBN-13 9781838825461
Pages 156 pages
Edition 1st Edition
Languages
Authors (2):
Shruti Jadon Shruti Jadon
Profile icon Shruti Jadon
Ankush Garg Ankush Garg
Profile icon Ankush Garg
View More author details
Toc

Table of Contents (11) Chapters close

Exercises

In this section, we will first go through a simple exercise of regression of sinusoidal data using MAML.

A simple implementation of model-agnostic meta-learning

For this tutorial, we will be showcasing how we can apply MAML to learn a simple curve of sinusoidal data. The second part of this tutorial is available on GitHub, where we can learn about how to train MAML on mini-ImageNet using the torch-meta library.

Let's begin this tutorial by going through the following steps:

  1. Import all libraries:
import math
import random
import torch
from torch import nn
from torch.nn import functional as F
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
%matplotlib inline
  1. Create a simple...
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