0

I am new in federated learning and openfl. I have two separated (let's call them private) datasets and I want to send them to each collaborators separately. When I review tutorials, it seems that FederatedDataSet gets all the data together and split them into multiple sets and then FederatedModel function sends the same model and splits of data to each collaborators.

This is the code that have have from tutorials:

import openfl
from openfl.federated import FederatedModel, FederatedDataSet


fl_data = FederatedDataSet(train_data, train_labels, valid_data, valid_labels, batch_size, num_classes)
fl_model = FederatedModel(build_model, optimizer, loss_fn, data_loader= fl_data)

But suppose I have private data that I want to sent to each collaborators:

data for collaborator 1: train_data_1, train_label_1, valid_data_1, valid_label_1

data for collaborator 2: train_data_2, train_label_2, valid_data_2, valid_label_2

Now, I want to send the model and data to each collaborators separately and then train them. Something like this:

send(build_model, train_data_1, train_label_1, valid_data_1, valid_label_1, to_collaborator_1 )
send(build_model, train_data_2, train_label_2, valid_data_2, valid_label_2, to_collaborator_2 )

And then start training them. What are those commands and how can I train the model?

I really appreciate any help and insight.

Amin Kaveh
  • 117
  • 6

0 Answers0