-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Dev compress refactor #1690
Dev compress refactor #1690
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
docs/en_US/Compressor/Overview.md
Outdated
""" | ||
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. |
There was a problem hiding this comment.
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``
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
No description provided.