Search⌘ K
AI Features

Coding Exercise on Pretext Tasks

Explore how to implement an eight-way rotation prediction task on images as a pretext task in self-supervised learning. Understand how to modify a ResNet18 model for multi-class classification and apply image rotations, gaining practical coding experience with foundational techniques for learning from unlabeled data.

We'll cover the following...

Problem statement

In this coding exercise, you have to perform an 88-way rotation prediction pretext classification task. In the code snippet below, you need to implement:

  • The make_example() function, which takes a PIL image image and rotates it by {0°,45°,90°,135°,180°,225°,270°,315°}\{0\degree, 45\degree, 90\degree, 135\degree, 180\degree, 225\degree, ...