PrototypeFederatedGraphLearning<T>

Models & Types · AiDotNet.FederatedLearning.Graph

Prototype-based federated graph learning: clients share class prototypes instead of full model parameters.

Inheritance: FederatedLearningComponentBase<T> → PrototypeFederatedGraphLearning<T>

For Beginners

Sharing full GNN model parameters raises two concerns: (1) model parameters can leak information about the training graph, and (2) different clients may have very different graph structures that benefit from different model architectures. Prototype-based FGL addresses both:

How It Works

Benefits: Prototypes are much smaller than full models (K prototypes of dimension D vs. millions of parameters), more robust to topology heterogeneity, and reveal less about graph structure.

Constructors

Constructor Summary
PrototypeFederatedGraphLearning(FederatedGraphOptions options, int prototypeDim, int numClasses) Initializes a new instance of PrototypeFederatedGraphLearning.

Properties

Property Summary
IReadOnlyDictionary<int, Tensor<T>> GlobalPrototypes { get; } Gets the current global prototypes.

Methods

Method Summary
Dictionary<int, Tensor<T>> AggregatePrototypes() Aggregates prototypes from all registered clients into global prototypes.
Dictionary<int, Tensor<T>> ComputePrototypes(Tensor<T> nodeEmbeddings, Tensor<T> labels, int embeddingDim) Computes a client’s class prototypes from node embeddings and labels.
Dictionary<int, Tensor<T>> ComputePrototypes(Tensor<T> nodeEmbeddings, Tensor<T> labels, int embeddingDim, Dictionary<int, int> classSampleCounts) Computes a client’s class prototypes and the number of nodes behind each one (the weights used by RegisterClientPrototypes).
double ComputePrototypeLoss(Dictionary<int, Tensor<T>> clientPrototypes, double lambda) Computes prototype regularization loss: pull client prototypes toward global prototypes.
void RegisterClientPrototypes(int clientId, Dictionary<int, Tensor<T>> prototypes, Dictionary<int, int> classSampleCounts) Registers a client’s class prototypes for the current round.