Class SecureAggregationVector<T>
- Namespace
- AiDotNet.FederatedLearning.Privacy
- Assembly
- AiDotNet.dll
Implements secure aggregation for vector-based model updates.
public sealed class SecureAggregationVector<T> : FederatedLearningComponentBase<T>, IDisposable
Type Parameters
TThe numeric type for model parameters (e.g., double, float).
- Inheritance
-
SecureAggregationVector<T>
- Implements
- Inherited Members
Remarks
For Beginners: Secure aggregation lets the server compute the sum/average of client updates without learning any single client's update. Each client adds pairwise masks derived from shared secrets. The masks are constructed so they cancel out in the aggregate.
This implementation provides a synchronous, full-participation secure aggregation mode. If a client drops out after masks are created, the round must be restarted (dropout-resilient unmasking is a separate protocol step and is intentionally not part of this in-memory component).
Constructors
SecureAggregationVector(int, int?)
public SecureAggregationVector(int parameterCount, int? randomSeed = null)
Parameters
Methods
AggregateSecurely(Dictionary<int, Vector<T>>, Dictionary<int, double>)
public Vector<T> AggregateSecurely(Dictionary<int, Vector<T>> maskedUpdates, Dictionary<int, double> clientWeights)
Parameters
maskedUpdatesDictionary<int, Vector<T>>clientWeightsDictionary<int, double>
Returns
- Vector<T>
AggregateSumSecurely(Dictionary<int, Vector<T>>)
public Vector<T> AggregateSumSecurely(Dictionary<int, Vector<T>> maskedUpdates)
Parameters
maskedUpdatesDictionary<int, Vector<T>>
Returns
- Vector<T>
ClearSecrets()
public void ClearSecrets()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
~SecureAggregationVector()
protected ~SecureAggregationVector()
GeneratePairwiseSecrets(List<int>)
public void GeneratePairwiseSecrets(List<int> clientIds)
Parameters
MaskUpdate(int, Vector<T>)
public Vector<T> MaskUpdate(int clientId, Vector<T> clientUpdate)
Parameters
clientIdintclientUpdateVector<T>
Returns
- Vector<T>
MaskUpdate(int, Vector<T>, double)
public Vector<T> MaskUpdate(int clientId, Vector<T> clientUpdate, double clientWeight)
Parameters
Returns
- Vector<T>