-
Notifications
You must be signed in to change notification settings - Fork 792
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 ios sdk and example with CoreML #1289
Conversation
Thanks for the PR @danielnugraha, very cool! Could you move the code into |
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.
Finished a first high-level review of this PR and left a few comments (mainly updating the README and potentially shortening server.py
). I look forward to merging it soon to make it available to the community, we can then continue to iterate on the iOS example/SDK in follow-up PRs.
The biggest update we'll have to do in a follow-up PR is to make it compatible with Flower 1.0 (which changes transport.proto
to handle optional client methods).
Again, thanks for the PR, great work!
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.
Hi @danielnugraha, just one comment about the strategy left, apart from that it looks good!
Reference Issues/PRs
What does this implement/fix? Explain your changes.
Added a Flower iOS SDK (as a Swift package) for Flower client and a working example with CoreML.
Transport.proto is compiled using Swift protobuf compiler plug-in provided by grpc-swift and produces 2 files, 1 for the messages and 1 for the services.
The Flower client in iOS is translated from python and uses the same structure as python Flower client.
The only exception is the Parameter file. Right now to be able to use the python server out of the box and its built in strategies the model parameters from the client will be converted into numpy array using Python-iOS and sent as bytes to the server as a message in FitRes or getParameters.
Model parameters from the server will also be converted to swift array (in this case MLMultiArray).
The example uses a Digit Recognition CoreML Model and MNIST Dataset as csv (there are no official dataset for swift so I use the dataset provided in https://github.com/JacopoMangiavacchi/MNIST-CoreML-Training).
How to test: