generated from benchopt/template_benchmark
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLN simplify model API+add more documentation (#12)
- Loading branch information
Showing
13 changed files
with
257 additions
and
235 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,36 +1,28 @@ | ||
from benchopt import BaseDataset, safe_import_context | ||
|
||
|
||
# Protect the import with `safe_import_context()`. This allows: | ||
# - skipping import to speed up autocompletion in CLI. | ||
# - getting requirements info when all dependencies are not installed. | ||
with safe_import_context() as import_ctx: | ||
from braindecode.datasets import MOABBDataset | ||
from benchmark_utils import windows_data | ||
|
||
|
||
# All datasets must be named `Dataset` and inherit from `BaseDataset` | ||
|
||
class Dataset(BaseDataset): | ||
|
||
name = "Zhou" | ||
|
||
parameters = {'paradigm_name': ('LeftRightImagery', 'MotorImagery')} | ||
# List of parameters to generate the datasets. The benchmark will consider | ||
# the cross product for each key in the dictionary. | ||
# Any parameters 'param' defined here is available as `self.param`. | ||
|
||
def get_data(self): | ||
"""Returns the data to be passed to Objective.set_data. | ||
Data | ||
---- | ||
Dataset: an instance of a braindecode.WindowsDataset | ||
sfreq: the sampling frequency of the data. | ||
""" | ||
|
||
# The return arguments of this function are passed as keyword arguments | ||
# to `Objective.set_data`. This defines the benchmark's | ||
# API to pass data. It is customizable for each benchmark. | ||
dataset_name = "Zhou2016" | ||
data = MOABBDataset(dataset_name=dataset_name, | ||
subject_ids=None) | ||
paradigm_name = "LeftRightImagery" | ||
data = MOABBDataset(dataset_name=dataset_name, subject_ids=None) | ||
|
||
dataset, sfreq = windows_data(data, "LeftRightImagery") | ||
dataset, sfreq = windows_data(data, paradigm_name) | ||
|
||
return dict(dataset=dataset, | ||
paradigm_name="LeftRightImagery", | ||
sfreq=sfreq) | ||
return dict(dataset=dataset, sfreq=sfreq) |
This file contains 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 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.