UNPKG

federer

Version:

Experiments in asynchronous federated learning and decentralized learning

52 lines 2.32 kB
import { Logger } from "winston"; import { Coordinator, CoordinatorOptions, IPCServer, StopCondition } from "../../../coordinator"; import { MnistModelName, MnistModelOptions } from "./model"; import { DatasetName } from "./data/download"; import { MnistPreprocessResult } from "./preprocess"; export interface MnistCoordinatorOptions extends CoordinatorOptions { /** Name of the dataset to use. */ dataset: DatasetName; /** Options for the ML model. */ model: CoordinatorOptions["model"] & { /** Name of the model to use. */ name: MnistModelName; }; /** Number of label classes to include in the experiment. */ numberLabelClasses: number; /** * Number of batches of digits per client. * * Like in the FedAvg paper, our preprocessing consists of sorting the data by * label, splitting it into batches and assigning each client shard * `numberDigitBatchesPerClient` batches. * * This option therefore roughly controls the number of different digits that * each client can hold; but note that it does not represent the exact number * of different digits that each client holds. */ numberDigitBatchesPerClient: number; shardingOptions: ShardingOptions; } export declare type ShardingOptions = BalancedShardingOptions | UnbalancedShardingOptions; export interface BalancedShardingOptions { type: "balanced"; } export interface UnbalancedShardingOptions { /** Makes the dataset unbalanced using Zipf's law*/ type: "unbalanced"; /**Skew factor is the exponent in the zipf's law */ skewFactorS: number; /**Sorted lable split determines what fraction of dataset should be used * to uniformly distribute to users. Remaining is passed to create skew */ sortedLabelSplit: number; } export declare class MnistCoordinator extends Coordinator { protected readonly experimentName: string; protected readonly options: Readonly<MnistCoordinatorOptions>; protected readonly modelOptions: MnistModelOptions; constructor(options: Readonly<MnistCoordinatorOptions>, ipc: IPCServer, logger: Logger, stopCondition?: StopCondition); protected preprocessData(): Promise<MnistPreprocessResult>; protected getRunName(): string; } //# sourceMappingURL=MnistCoordinator.d.ts.map