Skip to Content
Hands-On Meta Learning with Python
book

Hands-On Meta Learning with Python

by Sudharsan Ravichandiran
December 2018
Beginner to intermediate
226 pages
7h 59m
English
Packt Publishing
Content preview from Hands-On Meta Learning with Python

Adversarial meta learning

Now, we define a class called ADML where we implement the ADML algorithm. In the __init__ method, we will initialize all of the necessary variables. Then, we define our sigmoid function and we define our train function.

We will see this step-by-step and later see the final code as a whole:

class ADML(object):

We define the __init__ method and initialize necessary variables:

    def __init__(self):

We initialize a number of tasks—that is, the number of tasks we need in each batch of tasks:

        self.num_tasks = 2

We initialize a number of samplesthat is, a number of shots—a number of data points (k) we need to have in each task:

        self.num_samples = 10

We initialize a number of epochsthat is, training iterations:

 self.epochs ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On One-shot Learning with Python

Hands-On One-shot Learning with Python

Shruti Jadon, Ankush Garg
Hands-On Transfer Learning with Python

Hands-On Transfer Learning with Python

Dipanjan Sarkar, Raghav Bali, Tamoghna Ghosh
Python Deep Learning Projects

Python Deep Learning Projects

Matthew Lamons, Rahul Kumar, Abhishek Nagaraja
Advanced Deep Learning with Keras

Advanced Deep Learning with Keras

Rowel Atienza, Neeraj Verma, Valerio Maggio

Publisher Resources

ISBN: 9781789534207Supplemental Content