|
a |
|
b/oldexamples/exampleBV.py |
|
|
1 |
#conda create -n deepeeg |
|
|
2 |
#source activate deepeeg |
|
|
3 |
#chomd +x install.sh |
|
|
4 |
#bash install.sh |
|
|
5 |
#!git clone https://github.com/kylemath/eeg-notebooks_v0.1 |
|
|
6 |
#python |
|
|
7 |
from utils import * |
|
|
8 |
data_dir = '/Users/kylemathewson/Desktop/' |
|
|
9 |
exp = 'bikepark' |
|
|
10 |
#subs = [ '009'] |
|
|
11 |
subs = ['005', '007', '009', '010', '012', '013', '014', '015', '016', '019'] |
|
|
12 |
|
|
|
13 |
sessions = ['quiet','traffic'] |
|
|
14 |
nsesh = len(sessions) |
|
|
15 |
event_id = {'Standard': 1, 'Target': 2} |
|
|
16 |
|
|
|
17 |
#https://martinos.org/mne/stable/auto_tutorials/plot_visualize_evoked.html |
|
|
18 |
epochs = [] |
|
|
19 |
for sub in subs: |
|
|
20 |
print('Loading data for subject ' + sub) |
|
|
21 |
#Load Data |
|
|
22 |
raw = LoadBVData(sub,sessions,data_dir,exp) |
|
|
23 |
#Pre-Process EEG Data |
|
|
24 |
epochs.append(PreProcess(raw,event_id,emcp=True,rereference=True, |
|
|
25 |
plot_erp=True)) |
|
|
26 |
|
|
|
27 |
epochs = concatenate_epochs(epochs) |
|
|
28 |
print(epochs) |
|
|
29 |
|
|
|
30 |
#Engineer Features for Model |
|
|
31 |
feats = FeatureEngineer(epochs,model_type='NN',electrode_median=False) |
|
|
32 |
#Create Model |
|
|
33 |
model,_ = CreateModel(feats, units=[16,16], dropout=.15) |
|
|
34 |
#Train with validation, then Test |
|
|
35 |
TrainTestVal(model,feats) |
|
|
36 |
|
|
|
37 |
|