Last active
February 18, 2016 16:08
-
-
Save beckdaniel/693b851fdb48d3c28911 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
import numpy as np | |
import GPy | |
from sklearn.svm import SVR | |
import sys | |
import memory_profiler as mprof | |
model = sys.argv[1] | |
feats = np.random.random(size=(100,10)) | |
labels = np.random.random(size=(100,1)) | |
def f(): | |
for i in xrange(its): | |
if model == "gpy": | |
m = GPy.models.GPRegression(feats, labels) | |
elif model == "svm": | |
m = SVR(feats, labels.flatten()) | |
if model == 'svm': | |
its = 500000 | |
elif model == 'gpy': | |
its = 1000 | |
mem_usage = mprof.memory_usage(f, timeout=10, interval=0.2) | |
print mem_usage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment