Description
The LearningToCompare_FSL repository hosts the PyTorch implementation for the "Learning to Compare: Relation Network for Few-Shot Learning" paper, presented at CVPR 2018. This project specifically addresses the Few-Shot Learning (FSL) component of the research, enabling users to replicate and experiment with the Relation Network model.
Read More
The codebase is designed to facilitate training and evaluation on popular few-shot learning benchmarks. It includes scripts for both the Omniglot and mini-Imagenet datasets. For Omniglot experiments, pre-resized images are provided directly within the repository. For mini-Imagenet, users are instructed to download the dataset and preprocess it using the provided `proc_image.py` script, following a methodology similar to that used in the MAML (Model-Agnostic Meta-Learning) framework.
The repository offers clear command-line instructions for training models with various configurations, such as different numbers of ways (classes) and shots (examples per class) for both Omniglot and mini-Imagenet. For instance, users can train for Omniglot 5-way 1-shot or 5-way 5-shot, and similarly for mini-Imagenet. The training scripts allow for adjustments to the batch size parameter, which can be modified based on available GPU memory. The repository also notes that it currently loads pre-trained models, with instructions on how to delete them for users wishing to train from scratch.
Testing procedures are also outlined, with example commands for evaluating the trained models on specific few-shot learning tasks. The project is built using Python 2.7 and PyTorch 0.3. For those interested in the Zero-Shot Learning part of the original paper, a separate link to the relevant repository is provided. The project is licensed under the MIT license, promoting open access and modification.
This resource is valuable for researchers and practitioners in the field of meta-learning and few-shot learning, providing a direct implementation of a foundational paper in relation-based meta-learning approaches. It serves as a practical tool for understanding and advancing few-shot learning techniques.
- CategoryAI Models & LLMs
- Pricing ModelOpen source
- DeploymentSelf-hosted
- PlatformsLinux
LearningToCompare_FSL's Core Features
PyTorch implementation of Relation Network for Few-Shot Learning
Code for CVPR 2018 paper 'Learning to Compare'
Supports Omniglot dataset experiments
Supports mini-Imagenet dataset experiments
Includes scripts for training few-shot learning models
Includes scripts for testing few-shot learning models
Preprocessed Omniglot images provided
Data preprocessing script for mini-Imagenet
Configurable training parameters (ways, shots, batch size)
Option to train from scratch or use pre-trained models
MIT License
Getting Started with LearningToCompare_FSL
Set up environment: Install Python 2.7 and PyTorch 0.3
Prepare data: Download mini-Imagenet and run `proc_image.py` if needed
Train model: Execute training scripts (e.g., `omniglot_train_one_shot.py`) with desired parameters
Test model: Run testing scripts (e.g., `omniglot_test_one_shot.py`) to evaluate performance
Adapt parameters: Adjust batch size (`-b`) based on GPU memory
Explore Zero-Shot Learning: Visit the linked repository for ZSL implementation
LearningToCompare_FSL's Use Cases
- Few-Shot Image Classification
- Meta-Learning Research
- Model Replication
- Few-Shot Learning Benchmarking
- Transfer Learning Exploration









