Skip to content

Instantly share code, notes, and snippets.

@beckdaniel
Last active February 18, 2016 16:08
Show Gist options
  • Save beckdaniel/693b851fdb48d3c28911 to your computer and use it in GitHub Desktop.
Save beckdaniel/693b851fdb48d3c28911 to your computer and use it in GitHub Desktop.
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