Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
41faab39
Unverified
Commit
41faab39
authored
Apr 09, 2020
by
chicm-ms
Committed by
GitHub
Apr 09, 2020
Browse files
Fix lottery ticket (#2286)
parent
065d788c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/sdk/pynni/nni/compression/torch/pruners.py
src/sdk/pynni/nni/compression/torch/pruners.py
+4
-4
No files found.
src/sdk/pynni/nni/compression/torch/pruners.py
View file @
41faab39
...
...
@@ -329,10 +329,6 @@ class LotteryTicketPruner(Pruner):
reset_weights : bool
Whether reset weights and optimizer at the beginning of each round.
"""
super
().
__init__
(
model
,
config_list
,
optimizer
)
self
.
curr_prune_iteration
=
None
self
.
prune_iterations
=
config_list
[
0
][
'prune_iterations'
]
# save init weights and optimizer
self
.
reset_weights
=
reset_weights
if
self
.
reset_weights
:
...
...
@@ -344,6 +340,10 @@ class LotteryTicketPruner(Pruner):
if
lr_scheduler
is
not
None
:
self
.
_scheduler_state
=
copy
.
deepcopy
(
lr_scheduler
.
state_dict
())
super
().
__init__
(
model
,
config_list
,
optimizer
)
self
.
curr_prune_iteration
=
None
self
.
prune_iterations
=
config_list
[
0
][
'prune_iterations'
]
def
validate_config
(
self
,
model
,
config_list
):
"""
Parameters
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment