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 ...

Get Hands-On Meta Learning with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.