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
c34194aa
Commit
c34194aa
authored
8 months ago
by
Leahcimali
Browse files
Options
Downloads
Patches
Plain Diff
Correct mistakes of data transform for centralized
parent
17c83ab4
Branches
Branches containing commit
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
+3
-3
3 additions, 3 deletions
src/utils_data.py
with
3 additions
and
3 deletions
src/utils_data.py
+
3
−
3
View file @
c34194aa
...
...
@@ -644,7 +644,7 @@ def centralize_data(list_clients: list, row_exp: dict) -> Tuple[DataLoader, Data
import
numpy
as
np
# Define data augmentation transforms
train_transform
,
test
_val
_transform
=
data_transformation
(
row_exp
)
train_transform
,
val_transform
,
test_transform
=
data_transformation
(
row_exp
)
# Concatenate training data from all clients
x_train
=
np
.
concatenate
([
list_clients
[
id
].
train_test
[
'
x_train
'
]
for
id
in
range
(
len
(
list_clients
))],
axis
=
0
)
...
...
@@ -660,8 +660,8 @@ def centralize_data(list_clients: list, row_exp: dict) -> Tuple[DataLoader, Data
# Create Custom Datasets
train_dataset
=
CustomDataset
(
x_train
,
y_train
,
transform
=
train_transform
)
val_dataset
=
CustomDataset
(
x_val
,
y_val
,
transform
=
test_
val_transform
)
test_dataset
=
CustomDataset
(
x_test
,
y_test
,
transform
=
test_
val_
transform
)
val_dataset
=
CustomDataset
(
x_val
,
y_val
,
transform
=
val_transform
)
test_dataset
=
CustomDataset
(
x_test
,
y_test
,
transform
=
test_transform
)
# Create DataLoaders
train_loader
=
DataLoader
(
train_dataset
,
batch_size
=
128
,
shuffle
=
True
)
...
...
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