I am trying to train deep learning neural nets on my AWS server using Python and H2O and I would like to enable GPU acceleration to speed up the training. Please let me know the code snippet to use GPU instead of CPU. AWS uses OpenGL. The elastic GPU type is eg1.xlarge with 4 GB memory.
The code for my model is:
nn = H2OGridSearch(model=H2ODeepLearningEstimator,
hyper_params = {
'activation' :[ "Rectifier","Tanh","Maxout","RectifierWithDropout","TanhWithDropout","MaxoutWithDropout"],
'hidden':[[20,20],[50,50],[30,30,30],[25,25,25,25]], ## small network, runs faster
# 'rate' :[0.0005,0.001,0.0015,0.002,0.0025,0.003,0.0035,0.0040,0.0045,0.005],
'l1':[0,1e-4,1e-6],
'l2':[0,1e-4,1e-6]
})
start_time = time.time()
nn.train(
train1_x, train1_y,train1,
score_validation_samples = 10000, ## sample the validation dataset (faster)
stopping_rounds = 2,
stopping_metric ="MSE", ## alternatives: "MSE","logloss","r2"
epochs=1000000,
stopping_tolerance = 0.01,
max_w2 = 10
)
end_time = time.time()
H2O-3 is only cpu enabled if you are interested in running an H2O.ai product that is GPU enabled please see H2O4GPU or Driverless AI (note: the latter is closed-source)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With