This project implements LMNN (Large Margin Nearest Neighbor Classification) from scratch using only NumPy, without relying on automated gradient tools like PyTorch.
- 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)
- Clone the repository:
git clone https://github.com/your-repo-name/lmnn cd lmnn_numpy - To run clustering demos, then you can get two images demonstrating the clustering performance:
python lmnn_demos.py
- 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


