Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Dev compress refactor #1690

Merged
merged 8 commits into from
Nov 4, 2019

Conversation

QuanluZhang
Copy link
Contributor

No description provided.

Copy link
Contributor

@chicm-ms chicm-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactoring.

@@ -9,13 +9,13 @@ You can easily compress a model with NNI compression. Take pruning for example,
```python
from nni.compression.torch import LevelPruner
config_list = [{ 'sparsity': 0.8, 'op_types': ['default'] }]
pruner = LevelPruner(config_list)
pruner(model)
pruner = LevelPruner(model, config_list)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logically a pruner should be a standalone component. It should not need a model to "create" a pruner. So this looks strange.
But I known we don't have a better solution yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, let's keep it for now

"""
Pruners should overload this method to provide mask for weight tensors.
The mask must have the same shape and type comparing to the weight.
It will be applied with `mul()` operation on the weight.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numpy/pandas use ``inline code``

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks


Parameters
----------
layer: LayerInfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a space before colon. My bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks

@QuanluZhang QuanluZhang merged commit 358bdb1 into microsoft:master Nov 4, 2019
@QuanluZhang QuanluZhang deleted the dev-compress-refactor branch February 20, 2020 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants