Skip to content
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

Dynamic Trial Window Selection #291

Merged
merged 7 commits into from
Aug 25, 2023
Merged

Dynamic Trial Window Selection #291

merged 7 commits into from
Aug 25, 2023

Conversation

tab-cmd
Copy link
Contributor

@tab-cmd tab-cmd commented Aug 24, 2023

Overview

Using the newly added range type parameter, this PR adds the functionality to select different trial windows after stimuli presentions for modeling, online task use, and visualization.

Ticket

https://www.pivotaltracker.com/story/show/182151298

Contributions

  • Update trial_length to trial_window
  • Update offline analysis to use the window to modify timing and extract length
  • Update copy phrase to use the new trial_window and maintain the assertions needed for operation
  • Update replay_session to use the trial_window while also being backward compatible with earlier versions. Removed the unused filter comparison we added when initially testing the inquiry reshaper.
  • Update EEG visualizations to use the new window (including any defined baseline period) and construct better topo map location given changing window lengths

Test

  • make test-all
  • Ran integration tests after generating new images for the non-targets
  • Trained a new model using the updated parameter and ran via replay_session

Documentation

  • Are documentation updates required? In-line, README, or documentation? In-line documentation added/updated.

Changelog

  • Is the CHANGELOG.md updated with your detailed changes? Not yet! Will do!

@tab-cmd tab-cmd requested review from lawhead and celikbasak August 24, 2023 20:33
static_offset = parameters.get("static_trigger_offset")

raw_data = load_raw_data(Path(session_path, f'{RAW_DATA_FILENAME}.csv'))
channels = raw_data.channels
sample_rate = raw_data.sample_rate

transform_params = parameters.instantiate(ERPTransformParams)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch. I knew I was missing this somewhere.

@@ -618,7 +622,7 @@
"type": "int"
},
"lang_model_type": {
"value": "MIXTURE",
"value": "UNIFORM",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like we had the same idea here. :)

@@ -171,12 +171,14 @@ def predict_proba(self, data: np.array) -> np.array:
posterior = np.exp(np.stack([log_post_0, log_post_1], axis=-1))
return posterior

def save(self, path: Path):
def save(self, path: Path) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may want to just delete these save and load methods to avoid confusion. The save module should be used now as it saves the entire class and uses a specific pickle version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are required as part of the base class, so I will hold off for now!

nontargets_with_old_model,
args.outdir)

breakpoint()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: remove this!

@tab-cmd tab-cmd merged commit fe3ab29 into 2.0.0rc4 Aug 25, 2023
@tab-cmd tab-cmd deleted the dynamic_window_selection branch August 25, 2023 20:54
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