Hello FOSS
Back to Projects
BeginnerIIT Bombay

Model Shrinker

Shrink a trained PyTorch model into a smaller, faster copy while keeping as much accuracy as possible. Supports pruning, quantization, distillation and decomposition.

Overview

Model Shrinker takes a PyTorch model you have already trained and returns a smaller, faster copy of it, without changing your original. It works with MLPs, CNNs and everything runs on your own machine.

The workflow has four steps:

  • compress():creates a smaller copy using the method you choose, such as l1_pruning.
  • compare():prints size, speed and accuracy side by side. Latency is measured by actually running the model.
  • finetune():trains the small model a little to win back lost accuracy.
  • Save the small model and use it.

Contributing

Explore the repository to understand the codebase, then browse open issues to find one that matches your skills. Submit a pull request following the project's contribution guidelines, and a mentor will review it and work with you until it's ready to merge.

Recent Activity