Skip to content
Advertisement

How can I prepare my image dataset for a federated model?

How could I transform my dataset (composed of images) in a federated dataset? I am trying to create something similar to emnist but for my own dataset.

tff.simulation.datasets.emnist.load_data( only_digits=True, cache_dir=None )

Advertisement

Answer

You will need to create the clientData object first

for example:

JavaScript

where create_dataset is a serializable function but first you have to prepare your images read this tutorial about preprocessing data

JavaScript

When you prepared your data pass it to the create_dataset function

JavaScript

after this step, you can make some preprocessing function

JavaScript

After this you could make a tf.data.Dataset which will be suitable for federated training.

JavaScript

After this your dataset is ready for federated learning!

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement