-
Notifications
You must be signed in to change notification settings - Fork 209
Add "recording"
to keys
in RecordingSampler
; docs fix
#614
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
Open
OverLordGoldDragon
wants to merge
4
commits into
braindecode:master
Choose a base branch
from
OverLordGoldDragon:patch-3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ class RecordingSampler(Sampler): | |
Parameters | ||
---------- | ||
metadata : pd.DataFrame | ||
DataFrame with at least one of {subject, session, run} columns for each | ||
window in the BaseConcatDataset to sample examples from. Normally | ||
DataFrame with at least one of {subject, session, run, recording} columns | ||
for each window in the BaseConcatDataset to sample examples from. Normally | ||
obtained with `BaseConcatDataset.get_metadata()`. For instance, | ||
`metadata.head()` might look like this: | ||
|
||
|
@@ -61,7 +61,11 @@ def _init_info(self, metadata, required_keys=None): | |
------- | ||
See class attributes. | ||
""" | ||
keys = [k for k in ["subject", "session", "run"] if k in self.metadata.columns] | ||
keys = [ | ||
k | ||
for k in ["subject", "session", "run", "recording"] | ||
if k in self.metadata.columns | ||
] | ||
if not keys: | ||
raise ValueError( | ||
"metadata must contain at least one of the following columns: " | ||
|
@@ -115,7 +119,11 @@ class SequenceSampler(RecordingSampler): | |
n_windows : int | ||
Number of consecutive windows in a sequence. | ||
n_windows_stride : int | ||
Number of windows between two consecutive sequences. | ||
Number of windows between two consecutive starts of sequences. | ||
n_windows_stride=1 is maximal overlap. | ||
n_windows_stride=n_windows is minimal overlap. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minimal overlap meaning no overlap or a single overlapping window? assume it is no overlap right? then maybe better to write like that? |
||
n_windows_stride>n_windows skips (n_windows_stride-n_windows) windows | ||
between every consecutive sequence. | ||
random : bool | ||
If True, sample sequences randomly. If False, sample sequences in | ||
order. | ||
|
This file contains hidden or 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
Oops, something went wrong.
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.
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.
what is a recording? how does a session differ from a recording?
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.
I don't know, sounds like a question for other maintainers.
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.
It's not consistent across all datasets; some use recording as a file unit, others use session, and some sessions have many recordings (I don't know why).