GitHunt
NH

nh2seven/MAML_pth

PyTorch implementations of various classification models adapted for few-shot learning using Model-Agnostic Meta-Learning.

MAML_pth

PyTorch implementations of various classification models adapted for few-shot learning using Model-Agnostic Meta-Learning.
The model is trained on the miniImageNet dataset using class-balanced episodic tasks.

Features

  • PyTorch implementations of various models, adapted for MAML
  • Meta-learning framework for few-shot tasks
  • Support for N-way K-shot training episodes
  • Few-shot learning support
  • Training on miniImageNet dataset
  • Checkpoint management for model states
  • Inference pipeline for predictions

Requirements

  • Python 3.11+
  • PyTorch 2.5+ (with CUDA 12.6)
  • Kaggle API credentials

Setup

  1. (Optional) Create a virtual environment:

    python -m venv venv
    source venv/bin/activate
    
    # OR
    
    conda create --name myenv python=3.11
    conda activate myenv
  2. Install dependencies:

    pip install -r requirements.txt
  3. Download and organize the dataset:

    chmod +x setup.sh
    ./setup.sh

Usage

Run the meta-learning training process:

python main.py

You can modify training/evaluation settings in config.yaml.

References

  1. AlexNet paper from NeurIPS Proceedings
  2. Pytorch implementation of AlexNet by dansuh17
  3. miniImageNet
  4. miniImageNet filelists

Languages

Python91.9%Shell8.1%

Contributors

Latest Release

v0.1.0May 28, 2025
GNU General Public License v3.0
Created April 3, 2025
Updated September 21, 2025