Giter VIP home page Giter VIP logo

Comments (6)

pyt1234 avatar pyt1234 commented on June 6, 2024 4

@he-y I was wondering how did you prune the last conv in the residual block but not prune the downsample conv? how did you make the summation? For example:

name of layer: layer1.0.conv3.weight
*** small model torch.Size([180, 45, 1, 1])
*** big model torch.Size([256, 64, 1, 1])
name of layer: layer1.0.bn3.weight
*** small model torch.Size([180])
*** big model torch.Size([256])
name of layer: layer1.0.bn3.bias
*** small model torch.Size([180])
*** big model torch.Size([256])
name of layer: layer1.0.downsample.0.weight
*** small model torch.Size([256, 45, 1, 1])
*** big model torch.Size([256, 64, 1, 1])
name of layer: layer1.0.downsample.1.weight
*** small model torch.Size([256])
*** big model torch.Size([256])
name of layer: layer1.0.downsample.1.bias
*** small model torch.Size([256])
*** big model torch.Size([256])

180 vs 256 channels? Also, ref #38

from filter-pruning-geometric-median.

he-y avatar he-y commented on June 6, 2024

Please take a look at the dimension of the original and pruned model (Part of ResNet-50).

name of layer: conv1.weight
*** small model torch.Size([45, 3, 7, 7])
*** big model torch.Size([64, 3, 7, 7])
name of layer: bn1.weight
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: bn1.bias
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.0.conv1.weight
*** small model torch.Size([45, 45, 1, 1])
*** big model torch.Size([64, 64, 1, 1])
name of layer: layer1.0.bn1.weight
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.0.bn1.bias
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.0.conv2.weight
*** small model torch.Size([45, 45, 3, 3])
*** big model torch.Size([64, 64, 3, 3])
name of layer: layer1.0.bn2.weight
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.0.bn2.bias
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.0.conv3.weight
*** small model torch.Size([180, 45, 1, 1])
*** big model torch.Size([256, 64, 1, 1])
name of layer: layer1.0.bn3.weight
*** small model torch.Size([180])
*** big model torch.Size([256])
name of layer: layer1.0.bn3.bias
*** small model torch.Size([180])
*** big model torch.Size([256])
name of layer: layer1.0.downsample.0.weight
*** small model torch.Size([256, 45, 1, 1])
*** big model torch.Size([256, 64, 1, 1])
name of layer: layer1.0.downsample.1.weight
*** small model torch.Size([256])
*** big model torch.Size([256])
name of layer: layer1.0.downsample.1.bias
*** small model torch.Size([256])
*** big model torch.Size([256])
name of layer: layer1.1.conv1.weight
*** small model torch.Size([45, 256, 1, 1])
*** big model torch.Size([64, 256, 1, 1])
name of layer: layer1.1.bn1.weight
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.1.bn1.bias
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.1.conv2.weight
*** small model torch.Size([45, 45, 3, 3])
*** big model torch.Size([64, 64, 3, 3])
name of layer: layer1.1.bn2.weight
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.1.bn2.bias
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.1.conv3.weight
*** small model torch.Size([180, 45, 1, 1])
*** big model torch.Size([256, 64, 1, 1])
name of layer: layer1.1.bn3.weight
*** small model torch.Size([180])
*** big model torch.Size([256])
name of layer: layer1.1.bn3.bias
*** small model torch.Size([180])
*** big model torch.Size([256])
name of layer: layer1.2.conv1.weight
*** small model torch.Size([45, 256, 1, 1])
*** big model torch.Size([64, 256, 1, 1])
name of layer: layer1.2.bn1.weight
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.2.bn1.bias
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.2.conv2.weight
*** small model torch.Size([45, 45, 3, 3])
*** big model torch.Size([64, 64, 3, 3])
name of layer: layer1.2.bn2.weight
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.2.bn2.bias
*** small model torch.Size([45])
*** big model torch.Size([64])
name of layer: layer1.2.conv3.weight
*** small model torch.Size([180, 45, 1, 1])
*** big model torch.Size([256, 64, 1, 1])
name of layer: layer1.2.bn3.weight
*** small model torch.Size([180])
*** big model torch.Size([256])
name of layer: layer1.2.bn3.bias
*** small model torch.Size([180])
*** big model torch.Size([256])

from filter-pruning-geometric-median.

Yuting-Gao avatar Yuting-Gao commented on June 6, 2024

from filter-pruning-geometric-median.

he-y avatar he-y commented on June 6, 2024

Please take a look at this implementation.

from filter-pruning-geometric-median.

Yuting-Gao avatar Yuting-Gao commented on June 6, 2024

The results in geometric median use the soft filter pruning strategy, right?

from filter-pruning-geometric-median.

he-y avatar he-y commented on June 6, 2024

The final structures of these two methods are the same.
The differences are the pruning criterion and performance.

from filter-pruning-geometric-median.

Related Issues (20)

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.