Skip to content
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

How to send two separated data to two different collaborators? #779

Open
amin-kaveh opened this issue Mar 27, 2023 Discussed in #778 · 0 comments
Open

How to send two separated data to two different collaborators? #779

amin-kaveh opened this issue Mar 27, 2023 Discussed in #778 · 0 comments

Comments

@amin-kaveh
Copy link

Discussed in #778

Originally posted by amin-kaveh March 27, 2023
Hi,

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:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant