-
Notifications
You must be signed in to change notification settings - Fork 207
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
Add pytorch MNIST Workflow tutorial with FedProx #1158
Add pytorch MNIST Workflow tutorial with FedProx #1158
Conversation
@ynonflumintel I think this is not the correct file in this commit, I dont see workflow api getting used in this file. |
openfl-tutorials/Federated_FedProx_PyTorch_MNIST_Workflow_Tutorial.ipynb
Outdated
Show resolved
Hide resolved
3624c38
to
c73dd09
Compare
I pushed the wrong version of the file before, please take a look now |
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.
Looks great, thanks @ynonflumintel ! I just have a couple of small suggestions:
openfl-tutorials/Federated_FedProx_PyTorch_MNIST_Workflow_Tutorial.ipynb
Outdated
Show resolved
Hide resolved
openfl-tutorials/Federated_FedProx_PyTorch_MNIST_Workflow_Tutorial.ipynb
Outdated
Show resolved
Hide resolved
openfl-tutorials/Federated_FedProx_PyTorch_MNIST_Workflow_Tutorial.ipynb
Outdated
Show resolved
Hide resolved
openfl-tutorials/Federated_FedProx_PyTorch_MNIST_Workflow_Tutorial.ipynb
Outdated
Show resolved
Hide resolved
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.
PS: don't forget to sign off your commits for a successful CI run (DCO job):
git commit -s -m "..."
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.
General comment on the entire notebook: Include output of all the cells. New users should have visibility into the cells and evaluate for themselves if the notebook fulfils their goal of visit. Not showing output, can put-off newcomers because they end goal is not "visible".
openfl-tutorials/Federated_FedProx_PyTorch_MNIST_Workflow_Tutorial.ipynb
Outdated
Show resolved
Hide resolved
openfl-tutorials/Federated_FedProx_PyTorch_MNIST_Workflow_Tutorial.ipynb
Outdated
Show resolved
Hide resolved
" loss.backward()\n", | ||
" self.optimizer.step()\n", | ||
"\n", | ||
" if (len(data) * batch_idx) / len(self.train_loader.dataset) >= log_threshold:\n", |
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.
Instead of this complicated logic of calculating "quarter" of samples used, it is OK to print every 10 or 100 steps. We need to be cautious of all the cognitive overhead we put on the user.
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.
I ran experiments where there were a couple of thousand steps (small chunks), it's too spammy IMO
c73dd09
to
edd7e00
Compare
Thought it would be too verbose and increase the file size significantly, but I added them as per your request |
b8fbfbc
to
30ecf9e
Compare
Signed-off-by: Ynon Flum <[email protected]>
30ecf9e
to
448240c
Compare
This branch introduces a tutorial for setting up a neural network training federation using pytorch, the MNIST dataset using the openfl workflow API.