python - 如何在 Python 中对 H2O 启用 GPU 加速?

标签 python gpu h2o

我正在尝试使用 Python 和 H2O 在我的 AWS 服务器上训练深度学习神经网络,我想启用 GPU 加速来加速训练。请让我知道使用 GPU 而不是 CPU 的代码片段。 AWS 使用 OpenGL。弹性 GPU 类型为 eg1.xlarge,内存为 4 GB。

我的模型的代码是:

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()

最佳答案

如果您有兴趣运行支持 GPU 的 H2O.ai 产品,H2O-3 仅支持 CPU,请参阅 H2O4GPU或 Driverless AI(注意:后者是闭源的)

关于python - 如何在 Python 中对 H2O 启用 GPU 加速?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51711737/

相关文章:

python - 无法使用 flask-sqlalchemy 创建自动递增主键

python - Numpy:在每个时间步平均多个数据点

image - 这种裁剪算法更优雅的改写是什么? (在 Python 中)

c - 为什么我们无法访问主机端的设备内存?

r - 如何在 h2o 中重新分配 model_id

javascript - 获取网站词频计数的最佳方法?还是网站的一部分?

python - 如何解决 dist.init_process_group 挂起(或死锁)?

gpu - NetworkX all_pairs_dijkstras 的 CuGraph 实现

r - 如何快速将数据导入h2o

r - R 中的 H2O 错误 - 无法连接到本地主机