Giter Site home page Giter Site logo

pytorchpruner's Introduction

pytorchpruner

Do python setup.py install to install. Check notebooks/ for samples.

pytorchpruner is a pytorch package for pruning neural networks. It is intended for research and its main objective is not to provide fastest pruning framework, however it is relatively efficient and fast. It uses masking idea to simulate pruning and supports two main pruning strategies. It also implements various second order functions like hessian and hessian-vector product.

There are X main parts of the library

  1. Parameter Pruning (pytorchpruner.scorers): Saliency measures that return a same-sized-tensor of scores for each parameter in the provided parameter tensor.
  2. Unit Pruning (pytorchpruner.unitscorers): Saliency measures that return a vector of scores for each unit in the provided parameter tensor.
  3. Pruners (pytorchpruner.pruners): Has two different pruner engine for the two different pruning strategies (parameter vs unit). remove_empty_filters function in this file reduces the size of the network by copying the parameters into smaller tensors if possible.
  4. Auxiliary Modules (pytorchpruner.modules): implements meanOutputReplacer and maskedModule, the two important wrapper for torch.nn.Module instances. The first one replaces its output with the mean value, if enabled. And the second one simulates the pruning layers.
  5. Various first/second-order functionality (pytorchpruner.utils): implements hessian calculation, hessian-vector product, search functionality and some other utility functions.

pytorchpruner's People

Contributors

evcu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.