-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MRG] TimeDistributed class to apply a feature extractor model on a sequence of input windows #318
Conversation
Codecov Report
@@ Coverage Diff @@
## master #318 +/- ##
==========================================
+ Coverage 80.51% 80.58% +0.07%
==========================================
Files 49 49
Lines 3171 3183 +12
==========================================
+ Hits 2553 2565 +12
Misses 618 618 |
|
Great idea, let's think about naming a bit. I would suggest to move to own file, not in util. |
Here also, rebasing now should prevent test from failing hopefully |
1eab5bb
to
05e516b
Compare
Do you think it would make more sense to move it under I named it I'm not sure about |
braindecode/models/util.py
Outdated
``n_classes`` and ``dropout``. | ||
""" | ||
def __init__(self, feat_extractor, feat_size=None, n_windows=None, | ||
n_classes=None, dropout=0.25, clf=None): |
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.
How about instead if clf=None
, you really just return features? this would also remove immediately three arguments and make the class substantially simpler...
Yeah |
Maybe then it would make more sense to do something like in keras, i.e. just applying the feature extractor on multiple windows, and returning the features, and call this |
yeah sounds reasonable @hubertjb |
…a sequence of input windows - adding `return_feats` argument to SleepStagerChambon2018 to return features - updating sleep staging example with new TimeDistributed class - adding tests
05e516b
to
4d7e320
Compare
@robintibor I simplified the implementation, now it only does the feature extraction part. |
great makes sense to me now, merged |
This PR adds the
TimeDistributed
class that was defined in the sleep staging example tobraindecode.models.util
so that it can be reused elsewhere.