跳转至

NN Modules Tutorial

In FATE-1.10,the whole NN framework is re-designed for highly customizable machine learning. With this framework, you can create your own models, datasets, trainers, and aggregators to meet your specific needs. This tutorial introduces you to our brand new framework. With links below, you can learn how to use our Homo & Hetero(Horizontal and Vertical) NN step by step. Please notice that this tutorial is based on the standalone version, if you are using the cluster version, you may have to deploy the codes/data on every party respectively.

In FATE-1.11, we support federated large language model training with parameter efficient methods(Adapters).

Quick Start

To get yourself be familiar with FATE-NN and pipeline, we recommend completing these two quick start tutorials. If you are using tabular data and do not require any customizations, these tutorials should be sufficient for your needs

Homo-NN Customization

1.Dataset

Customizing a dataset in PyTorch is similar to using the built-in PyTorch Dataset class. In this chapter, we will use a simple image classification task - the MNIST Handwritten Recognition dataset - as an example to demonstrate how to customize and use your own dataset in FATE.

2.Loss Function

In this section, we show you how to customize loss functions

3.Model

In FATE 1.10, you can create a PyTorch model by subclassing nn.Module. Using the example from the previous chapter, we will demonstrate how to develop, deploy, and use a more complex model in FATE.

4.Trainer

In order to show you how to develop your own Trainer, here we try to develop a simple Trainer to implement the FedProx algorithm (this is just an exsample, please do not use it for production). In addition, we will also show you how to use the interface that comes with TrainerBase to save the model, set the checkpoint, output the prediction results, and use the interface to display some data on FateBoard.

5.Aggregator

Hetero-NN Customization

Dataset

Top Model, Bottom Model & Interactive Layer & Loss

Advanced Examples

Here we offer some advanced examples of using FATE-NN framework.

FATE-LLM(Federated Large Language Models) Training

Resnet classification(Homo-NN)

Recommendation models(Homo-NN)

Federated Text Classification Using Bert(Homo-NN)

Node Classification Using GNN(Homo-NN)

Training on vertical-split heterogeneous data(Hetero-NN)


最后更新: 2023-05-31