Skip to content

[DRAFT] Protocol redesign #57

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

Draft
wants to merge 5 commits into
base: develop-eeg
Choose a base branch
from

Conversation

vmcru
Copy link
Contributor

@vmcru vmcru commented Apr 7, 2025

This pull request contains the integration of the new dataio files and paradigms. It looks to replace the bash files that run the experiment and the hyper-parameter optimization with new python files. The main changes pertain to the train.py file that loads the data using dataio files, new run_experiments.py file, and later a new run_hparam_optimization.py file that integrates with WANDB.

Copy link
Collaborator

@Drew-Wagner Drew-Wagner left a comment

Choose a reason for hiding this comment

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

My initial thoughts after a 30 second skim... I did not check the experiment runner or train files yet.

Comment on lines +27 to +31
def bandpass_resample():
@takes("epoch", "info", "target_sfreq", "fmin", "fmax")
@provides("epoch", "sfreq", "target_sfreq", "fmin", "fmax")
def _bandpass_resample(epoch, info, target_sfreq, fmin, fmax):
"""Bandpass filter and resample an epoch."""
Copy link
Collaborator

@Drew-Wagner Drew-Wagner Apr 7, 2025

Choose a reason for hiding this comment

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

This is more what I had in mind as it makes it easy to configure from the hparams file. See how it is a function which creates a dynamic item with the desired parameters?

DONT commit the suggestion directly, as it is just to illustrate

Suggested change
def bandpass_resample():
@takes("epoch", "info", "target_sfreq", "fmin", "fmax")
@provides("epoch", "sfreq", "target_sfreq", "fmin", "fmax")
def _bandpass_resample(epoch, info, target_sfreq, fmin, fmax):
"""Bandpass filter and resample an epoch."""
def bandpass_resample(target_sfreq, fmin, fmax):
@takes("epoch", "info")
@provides("epoch")
def _bandpass_resample(epoch, info):
"""Bandpass filter and resample an epoch."""

Copy link
Collaborator

Choose a reason for hiding this comment

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

This will allow us to do something like this in the yaml file:

dynamic_items:
- !apply:bandpass_resample
  fmin: 0.5
  fmax: 22
  target_sfreq: 128

Comment on lines +58 to +59
#dynamic_items:
# - !name:dataio.preprocessing.to_tensor
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should include all preprocessing steps.

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