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
TNumeric type.
TInputModel input type.
TOutputModel 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
aVector<T>bVector<T>
Returns
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
clientModelsDictionary<int, IFullModel<T, TInput, TOutput>>expectedParameterCountint
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
clientModelsDictionary<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
selectedClientIdsIReadOnlyList<int>clientParametersDictionary<int, Vector<T>>clientWeightsDictionary<int, double>useClientWeightsbool
Returns
- Vector<T>