What is few-shot learning?

Learning from a few data points is called few-shot learning or k-shot learning, where k specifies the number of data points in each of the class in the dataset.

Consider we are performing an image classification task. Say we have two classes – apple and orange – and we try to classify the given image as an apple or orange. When we have exactly one apple and one orange image in our training set, it is called one-shot learning; that is, we are learning from just one data point per each of the class. If we have, say, 11 images of an apple and 11 images of an orange, then that is called 11-shot learning. So, k in k-shot learning implies the number of data points we have per class.

There is also zero-shot learning, where we don't have any data points per class. Wait. What? How can we learn when there are no data points at all? In this case, we will not have data points, but we will have meta information about each of the class and we will learn from the meta information.

Since we have two classes in our dataset, that is, apple and orange, we can call it two-way k-shot learning. So, in n-way k-shot learning, n-way implies the number of classes we have in our dataset and k-shot implies a number of data points we have in each class.

We need our models to learn from just a few data points. In order to attain this, we train them in the same way; that is, we train the model on a very few data points. Say we have a dataset, . We sample a few data points from each of the classes present in our dataset and we call it support set. Similarly, we sample some different data points from each of the classes and call it query set.

We train the model with a support set and test it with a query set. We train the model in an episodic fashion—that is, in each episode, we sample a few data points from our dataset, , prepare our support set and query set, and train on the support set and test on the query set.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset