Skip to content
Snippets Groups Projects
Commit 370c2552 authored by Omar El Rifai's avatar Omar El Rifai
Browse files

Add gpu capability

parent 579f2e33
No related branches found
No related tags found
No related merge requests found
......@@ -250,7 +250,9 @@ def setup_experiment(row_exp: dict) -> Tuple[Server, list]:
import torch
list_clients = []
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
torch.manual_seed(row_exp['seed'])
imgs_params = {'mnist': (28,1) , 'fashion-mnist': (28,1), 'kmnist': (28,1), 'cifar10': (32,3)}
......@@ -263,6 +265,8 @@ def setup_experiment(row_exp: dict) -> Tuple[Server, list]:
model_server = Server(GenericConvModel(in_size=imgs_params[row_exp['dataset']][0], n_channels=imgs_params[row_exp['dataset']][1]))
model_server.model.to(device)
dict_clients = get_clients_data(row_exp['num_clients'],
row_exp['num_samples_by_label'],
row_exp['dataset'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment