Skip to content

Conversation

@VivianChencwy
Copy link
Contributor

  • Migrated to EEGDash for data import
  • Code cleanup
  • Complete tutorial documentation
  • Completed and verified the HTML documentation build

Copy link
Collaborator

@bruAristimunha bruAristimunha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More one iteration @VivianChencwy, FYI @arnodelorme

Comment on lines 76 to 87
class ManualWindowsDataset:
"""Custom dataset that ensures one window per event."""

def __init__(self, data, labels):
self.data = data
self.labels = labels

def __len__(self):
return len(self.data)

def __getitem__(self, idx):
return self.data[idx], self.labels[idx]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class ManualWindowsDataset:
"""Custom dataset that ensures one window per event."""
def __init__(self, data, labels):
self.data = data
self.labels = labels
def __len__(self):
return len(self.data)
def __getitem__(self, idx):
return self.data[idx], self.labels[idx]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is much better, but we need to iterate:

I'll continue with some general comments for now, and later I'll help you finish/help you more by committing directly:

  1. Let's remove the ManualWindowsDataset object; we'll use the baseconcat dataset.

  2. Similarly, let's use the existing functions in braindecode pre-processing to do the pre-processing, removing the OddballPreprocessor, which seems to only rename events and apply some processing. You can check in the startkit how we did this renaming and adapt your logic. In theory, it will be a function that you apply to the pre-processing.

  3. Let's also remove the logic of processing by subject; here, we will apply this to each raw data.

  4. For the model, let's import the eegconformer from braindecode, okay? Unless there's a reason why we need to redefine it.

Let's address these points first, and then we'll move on to training.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed feedback!
I’ve implemented the requested changes:

  1. Removed ManualWindowsDataset — now using braindecode's BaseConcatDataset directly via create_windows_from_events()
  2. Removed OddballPreprocessor — replaced with a simple rename_oddball_events() function used in the braindecode preprocessing pipeline via create_preprocessors()
  3. Removed per-subject processing logic — load_combined_arrays() now applies preprocessing directly to each raw recording using preprocess(dataset, preprocessors)
  4. Imported EEGConformer from braindecode — removed custom model definitions and now using from braindecode.models import EEGConformer
    The code is ready for review. If there are any other modifications needed, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants