Skip to content

lyttttt3333/LMNN_numpy

Repository files navigation

LMNN: Distance Metric Learning for Large Margin Nearest Neighbor Classification

This project implements LMNN (Large Margin Nearest Neighbor Classification) from scratch using only NumPy, without relying on automated gradient tools like PyTorch.

Highlights

  • Core implementation is in lmnn_lmpl.py.
  • Utilizes advanced masking techniques and batch operations for high training efficiency. (671.4 epochs / second in sandwish demo)

Getting Started

  1. Clone the repository:
    git clone https://github.com/your-repo-name/lmnn
    cd lmnn_numpy
    
  2. To run clustering demos, then you can get two images demonstrating the clustering performance:
    python lmnn_demos.py

LMNN Example LMNN Example

  1. To run experiments, choose TASK_NAME from "faces", "digits" and "wines", then you can get corrresponding results as well as baselines' performances:
    python lmnn_app.py --task TASK_NAME

LMNN Example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages