Created
May 19, 2020 02:57
-
-
Save RAMitchell/29f706e22ac98f3629ec82c1bb37e3fe to your computer and use it in GitHub Desktop.
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 GPUtil | |
import xgboost as xgb | |
print("Xgboost version: {}".format(xgb.__version__)) | |
n = 10000 | |
m = 100 | |
X = np.random.randn(n, m) | |
y = np.random.randn(n) | |
exp_models = [] | |
for i in range(3): | |
clf = xgb.XGBRegressor( | |
tree_method='gpu_hist', eta=0.1, max_depth=6, verbosity=0) | |
trained_model = clf.fit(X, y, verbose=False) | |
exp_models.append(trained_model) | |
print("Iteration {} device memory utilisation: {}mb".format(i, GPUtil.getGPUs()[0].memoryUsed)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment