My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Making Poketwo Autocatcher: Day 2

Kyle He's photo
Kyle He
·Mar 7, 2021·

1 min read

To create the dataset, you can borrow some code.

class Pokeset(Dataset):
    def __init__(self, images, labels=None, transforms=None):
        self.X = images
        self.y = labels
        self.transforms = transforms

    def __len__(self):
        return (len(self.X))

    def __getitem__(self, i):
        data = self.X.iloc[i, :]
        data = np.asarray(data).astype(np.uint8).reshape(28, 28, 1)

        if self.transforms:
            data = self.transforms(data)

        if self.y is not None:
            return (data, self.y[i])
        else:
            return data

train_data = Pokeset(train_images, train_labels, transform)
test_data = Pokeset(test_images, test_labels, transform)

I will be keeping the image generation software secret for privacy reasons. I will be defining, training, and testing the neural net tmrw!