Neural networks are probably the most popular machine learning algorithms in recent years. FATE provides a federated homogeneous neural network implementation. We simplified the federation process into three parties. Party A represents Guest,which acts as a task trigger. Party B represents Host, which is almost the same with guest except that Host does not initiate task. Party C serves as a coordinator to aggregate models from guest/hosts and broadcast aggregated model.
As its name suggested, in Homogeneous Neural Networks, the feature spaces of guest and hosts are identical. An optional encryption mode for model is provided. By doing this, no party can get the private model of other parties.
The Homo NN process is shown in Figure 1. Models of Party A and Party B have the same neural networks structure. In each iteration, each party trains its model on its own data. After that, all parties upload their encrypted (with random mask) model parameters to arbiter. The arbiter aggregates these parameters to form a federated model parameter, which will then be distributed to all parties for updating their local models. Similar to traditional neural network, the training process will stop when the federated model converges or the whole training process reaches a predefined max-iteration threshold.
Please note that random numbers are carefully generated so that the random numbers of all parties add up an zero matrix and thus disappear automatically. For more detailed explanations, please refer to [Secure Analytics: Federated Learning and Secure Aggregation]. Since there is no model transferred in plaintext, except for the owner of the model, no other party can obtain the real information of the model.
.. automodule:: federatedml.param.homo_nn_param :members:
tensorflow backend: |
other layers listed in tf.keras.layers will be supported in near feature.
|
||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pytorch backend: | There are some difference in nn configuration build by pytorch compared to tf or keras.
|
Note
For more information on task configuration, please refer to the [doc] under example first. In this part we only talk about the parameter configuration.
Since all parties training Homogeneous Neural Networks have the same network structure, a common practice is to configure parameters under algorithm_parameters, which is shared across all parties. The basic structure is:
{ "config_type": "nn", "nn_define": [layer1, layer2, ...] "batch_size": -1, "optimizer": optimizer, "early_stop": { "early_stop": early_stop_type, "eps": 1e-4 }, "loss": loss, "metrics": [metrics1, metrics2, ...], "max_iter": 10 }
Note
Some detailed examples can be found in the example directory
nn_define: | Each layer is represented as an object in json. Please refer to supported layers in Features part. |
---|---|
optimizer: | A json object is needed, please refer to supported optimizers in Features part. |
loss: | A string is needed, please refer to supported losses in Features part. |
others: |
|