Nearest Neighbor Mixing Function
Here's how to use the Nearest Neighbor Mixing function:
# Import the library
import charisius
# Initialize aggregator and vectors
aggregator = ...
vectors = [...]
# Call nearest_neighbor_mixing function
result = charisius.nearest_neighbor_mixing(aggregator, vectors)
Inputs
aggregator: object - The aggregator object containing the 'nb_byz' property.
vectors: list - The list of PyTorch Tensors to be processed.
Outputs
result: torch.Tensor - The processed vectors after applying the nearest neighbor mixing function.