Created
September 13, 2014 20:22
-
-
Save cjauvin/9bd1b6044fc703486c0c to your computer and use it in GitHub Desktop.
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
from joblib import Parallel, delayed | |
import numpy as np | |
N = 1000 | |
def big_fucking_computation(dir): | |
# do something with dir.. | |
# this should take some time.. | |
return np.random.random((784, N)) | |
res = Parallel(n_jobs=-1)(delayed(big_fucking_computation)(dir) | |
for dir in ['top', 'down', 'left', 'right']) | |
augmented = np.hstack(res) | |
print(augmented.shape) # (784, 4000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment