This repository has been archived by the owner on Jul 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 304
Sequential feature extractor remove_unused #348
Merged
Hakuyume
merged 8 commits into
chainer:master
from
yuyu2172:sequential-feature-extractor-getitem
Jul 23, 2017
Merged
Sequential feature extractor remove_unused #348
Hakuyume
merged 8 commits into
chainer:master
from
yuyu2172:sequential-feature-extractor-getitem
Jul 23, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yuyu2172
force-pushed
the
sequential-feature-extractor-getitem
branch
from
July 20, 2017 15:04
c56f021
to
2173223
Compare
I merged #347. Could you merge master branch to this PR? |
Merge after #349 |
yuyu2172
force-pushed
the
sequential-feature-extractor-getitem
branch
from
July 21, 2017 01:54
63cd9da
to
982f2f6
Compare
yuyu2172
force-pushed
the
sequential-feature-extractor-getitem
branch
from
July 21, 2017 05:28
a518f21
to
b4fc033
Compare
yuyu2172
changed the title
Sequential feature extractor getitem
Sequential feature extractor remove_unused
Jul 21, 2017
Hakuyume
reviewed
Jul 22, 2017
|
||
""" | ||
if self._feature_names is None: | ||
feature_names = (self.all_feature_names[-1],) |
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.
If _feature_names
is None
, we can simply use return
to skip this method.
Hakuyume
reviewed
Jul 22, 2017
delattr(ret, name) | ||
return ret | ||
def remove_unused(self): | ||
"""Delete all features that are not needed for the forward pass. |
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.
This function removes layers (function or link). I prefer Delete all layers
.
Hakuyume
approved these changes
Jul 23, 2017
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.
LGTM
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Merge after #347 .
I found that it is beneficial to have a method that chops off unnecessary part from a feature extractor.
For instance, an optimizer hook is called for all parameters even if they are not used in a computational graph.