Skip to content

Instantly share code, notes, and snippets.

@talhaanwarch
Last active November 24, 2020 02:06
Show Gist options
  • Save talhaanwarch/9d750a4f2a82f5ed72a88ba7cfa38533 to your computer and use it in GitHub Desktop.
Save talhaanwarch/9d750a4f2a82f5ed72a88ba7cfa38533 to your computer and use it in GitHub Desktop.
from joblib import Parallel, delayed
import numpy as np
import time
from mne_features.feature_extraction import FeatureExtractor
feature=['mean','variance','std']
fe = FeatureExtractor(sfreq=1024, selected_funcs=feature)
def f(x):
l =np.random.randint(0, 100, size=(100, 64, 3000))
return np.std(l[:,x,:],-1)
st=time.time()
results = Parallel(n_jobs=-1)(delayed(f)(i) for i in range(64))
print(time.time()-st)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment