Table of Contents

Class RobustFullModelAggregationStrategyBase<T, TInput, TOutput>

Namespace
AiDotNet.FederatedLearning.Aggregators
Assembly
AiDotNet.dll

Base class for robust aggregation strategies operating on IFullModel<T, TInput, TOutput> parameters.

public abstract class RobustFullModelAggregationStrategyBase<T, TInput, TOutput> : AggregationStrategyBase<IFullModel<T, TInput, TOutput>, T>, IAggregationStrategy<IFullModel<T, TInput, TOutput>>

Type Parameters

T

Numeric type.

TInput

Model input type.

TOutput

Model output type.

Inheritance
AggregationStrategyBase<IFullModel<T, TInput, TOutput>, T>
RobustFullModelAggregationStrategyBase<T, TInput, TOutput>
Implements
IAggregationStrategy<IFullModel<T, TInput, TOutput>>
Derived
Inherited Members

Methods

ComputeSquaredL2Distance(Vector<T>, Vector<T>)

protected double ComputeSquaredL2Distance(Vector<T> a, Vector<T> b)

Parameters

a Vector<T>
b Vector<T>

Returns

double

GetClientParametersOrThrow(Dictionary<int, IFullModel<T, TInput, TOutput>>, int)

protected static Dictionary<int, Vector<T>> GetClientParametersOrThrow(Dictionary<int, IFullModel<T, TInput, TOutput>> clientModels, int expectedParameterCount)

Parameters

clientModels Dictionary<int, IFullModel<T, TInput, TOutput>>
expectedParameterCount int

Returns

Dictionary<int, Vector<T>>

GetReferenceModelOrThrow(Dictionary<int, IFullModel<T, TInput, TOutput>>)

protected static (IFullModel<T, TInput, TOutput> ReferenceModel, int ParameterCount) GetReferenceModelOrThrow(Dictionary<int, IFullModel<T, TInput, TOutput>> clientModels)

Parameters

clientModels Dictionary<int, IFullModel<T, TInput, TOutput>>

Returns

(IFullModel<T, TInput, TOutput> ReferenceModel, int ParameterCount)

WeightedAverageOrUnweightedAverage(IReadOnlyList<int>, Dictionary<int, Vector<T>>, Dictionary<int, double>, bool)

protected Vector<T> WeightedAverageOrUnweightedAverage(IReadOnlyList<int> selectedClientIds, Dictionary<int, Vector<T>> clientParameters, Dictionary<int, double> clientWeights, bool useClientWeights)

Parameters

selectedClientIds IReadOnlyList<int>
clientParameters Dictionary<int, Vector<T>>
clientWeights Dictionary<int, double>
useClientWeights bool

Returns

Vector<T>