public EncodedGradientsAccumulator(int parties, double threshold) { this(parties, new EncodingHandler(threshold), 100 * 1024 * 1024L, 10, 1.0); }
@Override public boolean broadcastUpdates(INDArray updates) { /* we want to do 2 things here: 1) encode updates 2) send them somewhere */ INDArray message = encodeUpdates(updates); if (message != null) { sendMessage(message); return true; } else return false; } }
public EncodedGradientsAccumulator build() { if (handler == null) { if (boundary == null) handler = new EncodingHandler(threshold); else handler = new EncodingHandler(threshold, boundary); } EncodedGradientsAccumulator accumulator = new EncodedGradientsAccumulator(parties, handler, initialMemory, queueSize, boundary); return accumulator; } }