GithubHelp home page GithubHelp logo

toil2sweet / lottery-jackpots Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zyxxmu/lottery-jackpots

0.0 0.0 0.0 48 KB

Pytorch implementation of our paper accepted by TPAMI 2023 — Lottery Jackpots Exist in Pre-trained Models

Python 100.00%

lottery-jackpots's Introduction

Lottery Jackpots Exist in Pre-trained Models (Paper Link)

Requirements

  • Python >= 3.7.4
  • Pytorch >= 1.6.1
  • Torchvision >= 0.4.1

Reproduce the Experiment Results

  1. Download the pre-trained models from this link and place them in the pre-train folder.

  2. Select a configuration file in configs to reproduce the experiment results reported in the paper. For example, to find a lottery jackpot with 30 epochs for pruning 95% parameters of ResNet-32 on CIFAR-10, run:

    python cifar.py --config configs/resnet32_cifar10/90sparsity30epoch.yaml --gpus 0

    To find a lottery jackpot with 30 epochs for pruning 90% parameters of ResNet-50 on ImageNet, run:

    python imagenet.py --config configs/resnet50_imagenet/90sparsity30epoch.yaml --gpus 0

    Note that the data_path in the yaml file should be changed to the data.

Evaluate Our Pruned Models

We provide configuration, training logs, and pruned models reported in the paper. They can be downloaded from the provided links in the following table:

Model Dataset Sparsity Epoch Top-1 Acc. Link
VGGNet-19 CIFAR-10 90% 30(S) 93.88% link
VGGNet-19 CIFAR-10 90% 160(S) 93.94% link
VGGNet-19 CIFAR-10 95% 30(S) 93.49% link
VGGNet-19 CIFAR-10 95% 160(S) 93.74% link
VGGNet-19 CIFAR-100 90% 30(S) 72.59% link
VGGNet-19 CIFAR-100 90% 160(S) 74.61% link
VGGNet-19 CIFAR-100 95% 30(S) 71.76% link
VGGNet-19 CIFAR-100 95% 160(S) 73.35% link
ResNet-32 CIFAR-10 90% 30(S) 93.70% link
ResNet-32 CIFAR-10 90% 160(S) 94.39% link
ResNet-32 CIFAR-10 95% 30(S) 92.90% link
ResNet-32 CIFAR-10 95% 160(S) 93.41% link
ResNet-32 CIFAR-100 90% 30(S) 72.22% link
ResNet-32 CIFAR-100 90% 160(S) 73.43% link
ResNet-32 CIFAR-100 95% 30(S) 69.38% link
ResNet-32 CIFAR-100 95% 160(S) 70.31% link
ResNet-50 ImageNet 80% 30(S) 75.19% link
ResNet-50 ImageNet 90% 30(S) 72.43% link

To test our pruned models, download the pruned models and place them in the ckpt folder.

  1. Select a configuration file in configs to test the pruned models. For example, to evaluate a lottery jackpot for pruning ResNet-32 on CIFAR-10, run:

    python evaluate.py --config configs/resnet32_cifar10/evaluate.yaml --gpus 0

    To evaluate a lottery jackpot for pruning ResNet-50 on ImageNet, run:

    python evaluate.py --config configs/resnet50_imagenet/evaluate.yaml --gpus 0

lottery-jackpots's People

Contributors

lmbxmu avatar zyxxmu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.