Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Comparative-Evaluation-of-Clustered-Federated-Learning-Methods
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SIG
Projects
Vilagil - Federated Learning
Comparative-Evaluation-of-Clustered-Federated-Learning-Methods
Commits
370c2552
Commit
370c2552
authored
9 months ago
by
Omar El Rifai
Browse files
Options
Downloads
Patches
Plain Diff
Add gpu capability
parent
579f2e33
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils_data.py
+5
-1
5 additions, 1 deletion
src/utils_data.py
with
5 additions
and
1 deletion
src/utils_data.py
+
5
−
1
View file @
370c2552
...
...
@@ -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
'
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment