assertself.bound_modelisnotNoneandself.config_listisnotNone,'Model and/or config_list are not set in this pruner, please set them by reset() before compress().'
@@ -1095,24 +1097,26 @@ class ADMMPruner(BasicPruner):
...
@@ -1095,24 +1097,26 @@ class ADMMPruner(BasicPruner):
For detailed example please refer to :githublink:`examples/model_compress/pruning/admm_pruning_torch.py <examples/model_compress/pruning/admm_pruning_torch.py>`
For detailed example please refer to :githublink:`examples/model_compress/pruning/admm_pruning_torch.py <examples/model_compress/pruning/admm_pruning_torch.py>`
@@ -293,9 +294,9 @@ class SimulatedAnnealingPruner(IterativePruner):
...
@@ -293,9 +294,9 @@ class SimulatedAnnealingPruner(IterativePruner):
Parameters
Parameters
----------
----------
model : Module
model : Optional[Module]
The origin unwrapped pytorch model to be pruned.
The origin unwrapped pytorch model to be pruned.
config_list : List[Dict]
config_list : Optional[List[Dict]]
The origin config list provided by the user.
The origin config list provided by the user.
evaluator : Callable[[Module], float]
evaluator : Callable[[Module], float]
Evaluate the pruned model and give a score.
Evaluate the pruned model and give a score.
...
@@ -312,7 +313,7 @@ class SimulatedAnnealingPruner(IterativePruner):
...
@@ -312,7 +313,7 @@ class SimulatedAnnealingPruner(IterativePruner):
This iterative pruner will use the chosen corresponding pruner to prune the model in each iteration.
This iterative pruner will use the chosen corresponding pruner to prune the model in each iteration.
pruning_params : Dict
pruning_params : Dict
If the chosen pruning_algorithm has extra parameters, put them as a dict to pass in.
If the chosen pruning_algorithm has extra parameters, put them as a dict to pass in.
log_dir : str
log_dir : Union[str, Path]
The log directory use to saving the result, you can find the best result under this folder.
The log directory use to saving the result, you can find the best result under this folder.
keep_intermediate_result : bool
keep_intermediate_result : bool
If keeping the intermediate result, including intermediate model and masks during each iteration.
If keeping the intermediate result, including intermediate model and masks during each iteration.
...
@@ -337,9 +338,9 @@ class SimulatedAnnealingPruner(IterativePruner):
...
@@ -337,9 +338,9 @@ class SimulatedAnnealingPruner(IterativePruner):
For detailed example please refer to :githublink:`examples/model_compress/pruning/simulated_anealing_pruning_torch.py <examples/model_compress/pruning/simulated_anealing_pruning_torch.py>`
For detailed example please refer to :githublink:`examples/model_compress/pruning/simulated_anealing_pruning_torch.py <examples/model_compress/pruning/simulated_anealing_pruning_torch.py>`