SparseUpdate<T>

Models & Types · AiDotNet.FederatedLearning.Adapters

Represents a sparse update: only a subset of indices have non-zero values. This is the communication-efficient representation used by SparseLoRA.

Constructors

Constructor Summary
SparseUpdate(int[] indices, T[] values, int totalLength) Creates a new sparse update.

Properties

Property Summary
T[] Values { get; } Values at the non-zero indices.
double Density { get; } Effective sparsity: fraction of elements that are non-zero.
int NnzCount { get; } Number of non-zero elements.
int TotalLength { get; } Total length of the full dense vector.
int[] Indices { get; } Indices of non-zero elements.