-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update simulation examples to use flwr_datasets
#2381
Conversation
flwr_datasets
Co-authored-by: Adam Narozniak <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The jupyter notebooks files need to be updated.
For the tensorflow, I think it's better if we use this approach (instead of directly to tensors)
tf_dataset = partition.to_tf_dataset(columns="img", label_cols="label", batch_size=64,
shuffle=True) # model.fit has shuffle = True so that is also not 100% needed
Or alternatively .with_format("numpy")
.
One thing about the .with_format("tf") I'm not sure is what happens if the GPU is present (tf by default uses GPU if it's available, so I'm not sure if the full data goes to GPU when e.g. trainset['images']
because it fetches all the images and it happens later in the code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I like the change in the TF example, it looks clean.
This PR updates the
simulation-pytorch
andsimulation-tensorflow
examples. They now use the Flower datasets API. The examples run just fine. Some things to iron out before merging:pyproject.toml
onceflwr_datasets
is inPyPI
tqdm
?sim.py
--> apply changes to notebook