Primary goal
Learn whether two handwritten character images belong to the same class.
Project documentation
Architecture, data pipeline, training flow, and repository map.
Overview
This project is a compact PyTorch reimplementation of Siamese Networks for One-Shot Learning. It targets the Omniglot dataset, trains a twin-branch image encoder, and evaluates performance with a 20-way one-shot matching setup.
Learn whether two handwritten character images belong to the same class.
The current implementation reports around 89.5% final accuracy, slightly below the original paper's 92%.
Docs map
Covers the Siamese encoder structure, embedding path, absolute-difference scoring, and the reasoning behind the final binary logit.
Explains how Omniglot samples are loaded, rotated, paired, and assembled into one-shot evaluation episodes.
Walks through flag parsing, loaders, optimization, checkpointing, test-time precision measurement, and produced artifacts.
Repository map
Defines the Siamese neural network, including the shared convolution tower, the 4096-dimensional projection layer, and the final similarity logit.
Implements the in-memory Omniglot training and testing datasets, pair sampling logic, image rotation augmentation, and one-shot evaluation episode layout.
Owns flag parsing, dataloader construction, optimizer setup, training loop, periodic evaluation, checkpoint saving, and final accuracy aggregation.
Provides the original quick-start instructions, requirement list, experiment summary, and the implementation differences relative to the paper.