adap/flower

How can the client send custom content messages to the server?

Opened this issue · 3 comments

What is your question?

Dear Flower developers,

Hello! Thank you for your excellent work in helping me solve many problems! However, I have a question and I sincerely ask for your assistance:
During the training process, the server needs to know the datashape of the client's dataset. How can I establish a connection between the client and server and at the same time send the datashape of the local dataset to the server?

Thank you for your assistance!

Hi @zhangtian-3841 , thanks for reaching out.

There are several ways to achieve this.

  • The easiest way might be to add the shape of the dataset to the dict returned from fit or evaluate.
  • If the shapes are needed on the server before the training starts, you could use a custom Strategy that sends an empty message to all clients and asks them to return the shapes of their local datasets
  • [Experimental] Flower Next supports sending completely custom messages to clients, but the capability is only available in flwr-nightly and not documented yet

Hi @danieljanes ,thank you for response.
I will try to implement the functionality as you suggested, but How do I use flwr-nightly to customize the strategy, send an empty message to all clients, and request them to return the shape of their local datasets.
I look forward to you adding the usage of Flower Next to the Flower Framework Documentation.
Expressing sincere thanks to you.

Dear @danieljanes,

I have a follow up question to this. Let's say we send information to server through below method:

"- The easiest way might be to add the shape of the dataset to the dict returned from fit or evaluate."

Where do we see them on the server and Is it possible to do some processing on them? To give you context, I need to send numerical embedding of images to server from each client. We are trying to do some processing on them after that. Kindly help

Thank you