UNPKG

federer

Version:

Experiments in asynchronous federated learning and decentralized learning

94 lines 2.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const combinate_1 = tslib_1.__importDefault(require("combinate")); const grid_search_1 = require("./grid-search"); /** FedAsync Staleness Search Space */ const stalenessSearchSpace = [ // { // type: ["Constant"], // }, { type: ["Polynomial"], a: [0.5], }, // { // type: ["Hinge"], // a: [10], // b: [4], // }, ]; /** Server Search Space */ const serverSearchSpace = [ { server: ["FedCRDT"], numberClientsPerRound: [10], roundEndFraction: [0.5], a: [0.3, 0.5], alpha: [0.25], }, { server: ["FedSemiSync"], numberClientsPerRound: [10], roundEndFraction: [0.5], a: [0.3, 0.5], alpha: [0.25], }, { server: ["FedAvg"], fractionOfClientsPerRound: [0.1, 0.2], }, { server: ["FedAsync"], epochDelay: [100], alpha: [0.6, 0.8], staleness: stalenessSearchSpace.flatMap((el) => combinate_1.default(el)), }, ]; /** Search Space */ const searchSpace = { dataset: ["mnist", "fashion-mnist"], numberLabelClasses: [10], numberDigitBatchesPerClient: [2], model: [ { name: "2NN", optimizer: { name: "sgd", learningRate: 0.1, }, }, ], serverOptions: serverSearchSpace.flatMap((el) => combinate_1.default(el)), trainOptions: combinate_1.default({ batchSize: [10], epochs: [1], learningRateSchedule: [{ type: "none" }], }), tensorflowVerbosity: [0], clientDelays: [{ type: "none" }], // clientDelays: [ // { // type: "delay-groups", // groups: [ // { fraction: 0.25, delay: 0 }, // { fraction: 0.25, delay: 500 }, // { fraction: 0.25, delay: 1000 }, // { fraction: 0.25, delay: 1500 }, // ], // }, // ], logging: [{ configuration: "common", options: { minLogLevel: "debug" } }], instrument: [{ memoryUsage: true, uploadStaleness: true }], debug: [{ printDataDistribution: true }], shardingOptions: [ { type: "unbalanced", skewFactorS: 1.2, sortedLabelSplit: 0.5 }, ], }; const stopOptions = { targetAccuracy: 0.95, maxEpochs: 5000, }; /** Perform grid search over the search space */ void new grid_search_1.MnistGridSearch(stopOptions, combinate_1.default(searchSpace)).run(); //# sourceMappingURL=index.js.map