API overview

In this page you can find the list of modules/submodules defined in fluke with their classes and functions.

fluke

Classes

DDict

A dictionary that can be accessed with dot notation recursively.

GlobalSettings

Global settings for fluke.

ObserverSubject

Subject class for the observer pattern.

Singleton

This metaclass is used to create singleton classes.

fluke.data

Classes

DataContainer

Container for train and test data.

DummyDataContainer

DataContainer designed for those datasets with a fixed data assignments, e.g., FEMNIST, Shakespeare and FCUBE.

FastDataLoader

A DataLoader-like object for a set of tensors that can be much faster than TensorDataset + DataLoader because dataloader grabs individual indices of the dataset and calls cat (slow).

DataSplitter

Utility class for splitting the data across clients.

Submodules

datasets

This module contains the Datasets for loading the supported datasets.

support

This module contains utility classes for loading datasets.

fluke.client

Classes

Client

Base Client class.

PFLClient

Personalized Federated Learning client.

fluke.server

Classes

Server

Basic Server for Federated Learning.

fluke.comm

Classes

Message

This class represents a message that can be exchanged between clients and the server.

Channel

A bi-directional communication channel.

ChannelObserver

Channel observer interface for the Observer pattern.

fluke.nets

Classes

EncoderHeadNet

Encoder (aka backbone) + Head Network [Base Class] This type of networks are defined as two subnetworks, where one is meant to be the encoder/backbone network that learns a latent representation of the input, and the head network that is the classifier part of the model.

GlobalLocalNet

Global-Local Network (Abstract Class).

HeadGlobalEncoderLocalNet

This implementation of the Global-Local Network (GlobalLocalNet) is meant to be used with the Encoder-Head architecture.

EncoderGlobalHeadLocalNet

This implementation of the Global-Local Network (GlobalLocalNet) is meant to be used with the Encoder-Head architecture.

MNIST_2NN

Multi-layer Perceptron for MNIST.

MNIST_CNN

Convolutional Neural Network for MNIST.

FedBN_CNN

Convolutional Neural Network with Batch Normalization for CIFAR-10.

MNIST_LR

Logistic Regression for MNIST.

CifarConv2

Convolutional Neural Network for CIFAR-10.

ResNet9

ResNet-9 network for CIFAR-100 classification.

FEMNIST_CNN

Convolutional Neural Network for FEMNIST.

VGG9

VGG-9 network for FEMNIST classification.

ResNet18

ResNet-18 network as defined in the torchvision library.

ResNet34

ResNet-34 network as defined in the torchvision library.

ResNet50

ResNet-50 network as defined in the torchvision library.

ResNet18GN

ResNet-18 network as defined in the torchvision library but with Group Normalization layers instead of Batch Normalization.

MoonCNN

Convolutional Neural Network for CIFAR-10.

fluke.utils

Classes

OptimizerConfigurator

This class is used to configure the optimizer and the learning rate scheduler.

Configuration

Fluke configuration class.

ClientObserver

Client observer interface.

ServerObserver

Server observer interface.

Functions

import_module_from_str(name)

Import a module from its name.

get_class_from_str(module_name, class_name)

Get a class from its name.

get_loss(lname)

Get a loss function from its name.

get_model(mname, **kwargs)

Get a model from its name.

get_scheduler(sname)

Get a learning rate scheduler from its name.

clear_cache([ipc])

Clear the CUDA cache.

get_full_classname(classtype)

Get the fully qualified name of a class.

Submodules

log

This submodule provides logging utilities.

model

This submodule provides utilities for pytorch model manipulation.

log

This submodule provides logging utilities.

fluke.evaluation

Classes

Evaluator

This class is the base class for all evaluators in fluke.

ClassificationEval

Evaluate a PyTorch model for classification.

fluke.algorithms

Classes

CentralizedFL

Centralized Federated Learning algorithm.

PersonalizedFL

Personalized Federated Learning algorithm.

Submodules

apfl

Implementation of the APFL [APFL20] algorithm.

ccvr

Implementation of the CCVR [CCVR21] algorithm.

ditto

Implementation of the DITTO [Ditto21] algorithm.

fedala

Implementation of the FedALA [FedALA23] algorithm.

fedamp

Implementation of the FedAMP [FedAMP21] algorithm.

fedavg

Implementation of the Federated Averaging [FedAVG17] algorithm.

fedavgm

Implementation of the Federated Averaging with momentum [FedAVGM19] algorithm.

fedaws

Implementation of the Federated Averaging with Spreadout [FedAwS20] algorithm.

fedbabu

Implementation of the Federated Averaging with Body Aggregation and Body Update [FedBABU22] algorithm.

fedbn

Implementation of the FedBN [FedBN21] algorithm.

feddyn

Implementation of the FedDyn [FedDyn21] algorithm.

fedexp

Implementation of the FedExP [FedExP23] algorithm.

fedhp

Implementation of the FedHP: Federated Learning with Hyperspherical Prototypical Regularization [FedHP24] algorithm.

fedlc

Implementation of the [FedLC22] algorithm.

fednh

Implementation of the [FedNH23] algorithm.

fednova

Implementation of the [FedNova21] algorithm.

fedopt

Implementation of the [FedOpt21] algorithm.

fedper

Implementation of the [FedPer19] algorithm.

fedproto

Implementation of the FedProto [FedProto22] algorithm.

fedprox

Implementation of the [FedProx18] algorithm.

fedrep

Implementation of the [FedRep21] algorithm.

fedrod

Implementation of the FedROD [FedROD22] algorithm.

fedrs

Implementation of the [FedRS21] algorithm.

fedsam

Implementation of the [FedSAM22] algorithm.

fedsgd

Implementation of the [FedSGD17] algorithm.

lg_fedavg

Implementation of the [LG-FedAVG20] algorithm.

moon

Implementation of the [Moon21] algorithm.

per_fedavg

Implementation of the [Per-FedAVG20] algorithm.

pfedme

Implementation of the [pFedMe20] algorithm.

scaffold

Implementation of the [SCAFFOLD20] algorithm.

superfed

Implementation of the [SuPerFed22] algorithm.