Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: musco-ai/musco-pytorch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.6
Choose a base ref
...
head repository: musco-ai/musco-pytorch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Feb 16, 2021

  1. Update svd_layer.py

    juliagusak authored Feb 16, 2021
    Copy the full SHA
    e3e0822 View commit details
  2. Update svd_layer.py

    juliagusak authored Feb 16, 2021
    Copy the full SHA
    74b9f4a View commit details
Showing with 4 additions and 2 deletions.
  1. +4 −2 musco/pytorch/compressor/decompositions/svd_layer.py
6 changes: 4 additions & 2 deletions musco/pytorch/compressor/decompositions/svd_layer.py
Original file line number Diff line number Diff line change
@@ -136,6 +136,8 @@ def __init__(self, layer, layer_name,
self.layer = layer
self.pretrained = pretrained

self.min_rank = 2

#print(layer)

if isinstance(self.layer, nn.Sequential):
@@ -161,11 +163,11 @@ def __init__(self, layer, layer_name,
self.rank = rank
elif rank_selection == 'param_reduction':
if isinstance(self.layer, nn.Sequential):
prev_rank = self.layer[0].out_features
prev_rank = self.layer[0].out_channels
else:
prev_rank = None

self.rank = estimate_rank_for_compression_rate((self.out_features, self.in_features),
self.rank = estimate_rank_for_compression_rate((self.out_channels, self.in_channels),
rate = param_reduction_rate,
key = 'svd',
prev_rank = prev_rank,