Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
import numpy as np | |
import pandas as pd | |
import string | |
from collections import deque, Counter, defaultdict | |
from copy import deepcopy | |
from itertools import chain | |
from scipy.signal import convolve2d | |
from scipy.spatial import distance | |
from tqdm import tqdm | |
import matplotlib.pyplot as plt |
This file contains hidden or 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
channels: | |
- conda-forge | |
- omnia | |
- bioconda | |
dependencies: | |
- modeller | |
- mdtraj | |
- plyfile | |
- snakemake |
This file contains hidden or 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 should be a docstring. | |
Second line of the docstring. | |
""" | |
"""This should not be a docstring.""" | |
b"""This should not be a docstring.""" | |
r"""This should not be a docstring.""" | |
"This should not be a docstring." |
This file contains hidden or 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
""" | |
Test whether modifying the batch size changes the result | |
Authors: Marijn van Vliet <[email protected]> | |
""" | |
import torch | |
from torch.utils.data import DataLoader | |
from torchvision import datasets, transforms | |
import numpy as np |
This file contains hidden or 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
import mne | |
import surfer | |
from mayavi import mlab | |
# Various filenames we'll be needing | |
data_path = mne.datasets.sample.data_path() | |
subjects_dir = f'{data_path}/subjects' | |
fname_trans = f'{data_path}/MEG/sample/sample_audvis_raw-trans.fif' | |
fname_cov = f'{data_path}/MEG/sample/sample_audvis-cov.fif' | |
fname_evokeds = f'{data_path}/MEG/sample/sample_audvis-ave.fif' |
This file contains hidden or 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
" Linter (provided through ALE) | |
let g:ale_lint_on_text_changed = 'never' | |
let g:ale_lint_on_save = 1 | |
let g:ale_linters = { | |
\ 'python': ['flake8'], | |
\} | |
" By default, don't worry about PEP8 | |
let g:ale_python_flake8_options = "--ignore=E2,E3,E4,E5,E7,W" | |
let g:python_highlight_space_errors = 0 | |
This file contains hidden or 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
import mne | |
import numpy as np | |
import mne_rsa | |
dsms_file = np.load('pilot2_dsms.npz') | |
meg_dsms = dsms_file['dsms'] | |
model_dsms = ... # Up to you to create | |
# RSA: compare all MEG DSMs to all model DSMs | |
rsa_results = mne_rsa.rsa(meg_dsms, model_dsms, metric='spearman') |
This file contains hidden or 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
import mne | |
# MEG data we take from the MNE-Sample dataset | |
data_path = mne.datasets.sample.data_path() | |
subjects_dir = f'{data_path}/subjects' | |
evoked = mne.read_evokeds(f'{data_path}/MEG/sample/sample_audvis-ave.fif', condition='Left Auditory').apply_baseline() | |
noise_cov = mne.read_cov(f'{data_path}/MEG/sample/sample_audvis-cov.fif') | |
# MRI data we will take from the 'fsaverage' template brain | |
fs_dir = mne.datasets.fetch_fsaverage(verbose=True) # Download the files |
This file contains hidden or 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
import mne | |
from mayavi import mlab | |
data_path = mne.datasets.sample.data_path() | |
subjects_dir = f'{data_path}/subjects' | |
evoked = mne.read_evokeds(f'{data_path}/MEG/sample/sample_audvis-ave.fif', condition='Left Auditory').apply_baseline() | |
noise_cov = mne.read_cov(f'{data_path}/MEG/sample/sample_audvis-cov.fif') | |
bem = mne.make_sphere_model(r0='auto', head_radius='auto', info=evoked.info) | |
src = mne.setup_volume_source_space(bem=bem) |