コード例 #1
0
from models.crnl_net import NetAdapter

from skorch_ext.callbacks import LayerDataViz, EpochSummary, GetModuleOnTrainBegin

from functools import partial
from experiments.viz import Viz

viz = Viz()

expe_config = {
    'name':
    'crnl_net_adam_weighted_filtered',
    'dir':
    '/dycog/Jeremie/Loic/results',
    'datasets': [{
        'eeg_dataset': RSVP(),
        'include_subjects': ['VPfat', 'VPgcc'],
        'exclude_subjects': [],
        'apply_filter': {
            'l_freq': 0.1,
            'h_freq': 20.
        },
        #epochs params
        'exclude_channels': ['P8', 'O2'],
        'tmin': 0.0,
        'tmax': 0.5,

        #others params
        'cache': True
    }],
    'scenario':
コード例 #2
0
ファイル: viz.py プロジェクト: loic001/deepeeg
import shelve

import glob
import os
import numpy as np
import mne


from experiments.base import ExperimentLogger
from skorch_ext.netsaver import NetSaver

from torch_ext.pytorch_smoothgrad.gradients import VanillaGrad, SmoothGrad

from datasets.rsvp import RSVP
raw_mne = RSVP().get_subject_data('VPgcc').pick_types(eeg=True, exclude=['P8', 'O2'])

def ma(values, window):
    weights = np.repeat(1.0, window)/window
    sma = np.convolve(values, weights, 'valid')
    return sma

if __name__ == '__main__':
    import dill as pickle
    import copy


    d = '/dycog/Jeremie/Loic/results/eeg_net_sgd_weighted_filtered_fat/'

    g = os.path.join(d, '*.dat')
    for f in glob.glob(g):
        experiment_logger = ExperimentLogger(f[:-4], overwrite=False)