federer
Version:
Experiments in asynchronous federated learning and decentralized learning
21 lines • 662 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.staleness = void 0;
function staleness(serverRound, clientRound, options) {
switch (options.type) {
case "Constant":
return 1;
case "Polynomial":
return Math.pow(serverRound - clientRound + 1, -options.a);
case "Hinge": {
if (serverRound - clientRound <= options.b) {
return 1;
}
else {
return 1 / (options.a * (serverRound - clientRound + options.b) + 1);
}
}
}
}
exports.staleness = staleness;
//# sourceMappingURL=staleness.js.map