ray-project / tune-sklearn

A drop-in replacement for Scikit-Learn’s GridSearchCV / RandomizedSearchCV -- but with cutting edge hyperparameter tuning techniques.
https://docs.ray.io/en/master/tune/api_docs/sklearn.html
Apache License 2.0
467 stars 51 forks source link

How to tune Skorch model using GPU #271

Closed animeshkumarpaul closed 1 year ago

animeshkumarpaul commented 1 year ago

I can see the example here and, I use the parameter ‘use_gpu = True’, But Still It is not using the GPU.

https://github.com/ray-project/tune-sklearn/blob/6e813e18fb43156d32f0958794881c7c12d14f17/examples/torch_nn.py

net = NeuralNetClassifier( ClassifierModule, max_epochs=200, batch_size=50000, criterion=nn.CrossEntropyLoss, optimizer=torch.optim.Adam, lr=0.01 )

TuneGridSearchCV (estimator=net, param_grid=param, cv=grid_cv, n_jobs = 4, refit=True, return_train_score = True, verbose=3, scoring = 'average_precision', use_gpu = True)

Please Help