UNPKG

federer

Version:

Experiments in asynchronous federated learning and decentralized learning

27 lines 1.26 kB
import * as io from "socket.io"; import { ClientToServerMessages, FedAvgServerStartOptions, ServerToClientMessages, UploadMessage, Weights } from "../../common"; import { SyncFLState, SyncFLServer } from "./SyncFLServer"; interface RoundState extends SyncFLState { /** * Weights at the beginning of the round. Used to initialize the weights of * clients that might join in the middle of a round. */ readonly initialWeights: Weights; /** Mapping of Socket ID to the weights the client holds. */ clientWeights: Map<string, Weights>; } /** * Implementation of standard FedAvg, as described in * {@link https://arxiv.org/abs/1602.05629}. */ export declare class FedAvgServer extends SyncFLServer<RoundState, FedAvgServerStartOptions> { protected serverName: string; protected expectDeltaUpdates: boolean; registerSocketListeners(socket: io.Socket<ClientToServerMessages, ServerToClientMessages>): void; protected getInitialRoundState(initialWeights: Weights): RoundState; protected updateRoundState(message: UploadMessage, socketId: string): void; protected getRoundAverage(): Weights; protected incrementRoundState(roundAverage: Weights): void; } export {}; //# sourceMappingURL=FedAvgServer.d.ts.map