public class EncodingHandler extends Object implements MessageHandler
Modifier and Type | Field and Description |
---|---|
protected GradientsAccumulator |
accumulator |
protected AtomicInteger |
atomicBoundary |
protected ThreadLocal<AtomicBoolean> |
bitmapMode |
protected Double |
boundary |
protected org.nd4j.linalg.compression.NDArrayCompressor |
compressor |
protected ThreadLocal<com.google.common.util.concurrent.AtomicDouble> |
currentThreshold |
protected ThreadLocal<AtomicLong> |
iterations |
protected ThreadLocal<AtomicLong> |
lastStep |
protected double |
minThreshold |
protected int |
shakeFrequency |
protected int |
stepDelay |
protected double |
stepTrigger |
protected double |
threshold |
protected double |
thresholdStep |
Constructor and Description |
---|
EncodingHandler()
This method builds new EncodingHandler instance with initial threshold of 1e-3
|
EncodingHandler(double threshold)
This method builds new EncodingHandler instance
|
EncodingHandler(double threshold,
Double boundary)
This method builds new EncodingHandler instance
|
EncodingHandler(double threshold,
double minThreshold,
double thresholdStep,
double stepTrigger,
int stepDelay,
int shakeFrequency)
This method builds new EncodingHandler instance
|
EncodingHandler(double threshold,
double minThreshold,
double thresholdStep,
double stepTrigger,
int stepDelay,
int shakeFrequency,
Double boundary)
This method builds new EncodingHandler instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
broadcastUpdates(org.nd4j.linalg.api.ndarray.INDArray updates)
This method does broadcast of given update message across network
|
org.nd4j.linalg.api.ndarray.INDArray |
decodeUpdates(org.nd4j.linalg.api.ndarray.INDArray message)
Deprecated.
|
org.nd4j.linalg.api.ndarray.INDArray |
encodeUpdates(org.nd4j.linalg.api.ndarray.INDArray updates) |
void |
initialize(GradientsAccumulator accumulator)
This method does initial configuration of given MessageHandler instance
|
protected void |
sendMessage(org.nd4j.linalg.api.ndarray.INDArray message)
This method does loops encoded data back to updates queue
|
protected transient GradientsAccumulator accumulator
protected double threshold
protected double minThreshold
protected double thresholdStep
protected double stepTrigger
protected int shakeFrequency
protected int stepDelay
protected Double boundary
protected org.nd4j.linalg.compression.NDArrayCompressor compressor
protected AtomicInteger atomicBoundary
protected ThreadLocal<AtomicLong> iterations
protected ThreadLocal<AtomicLong> lastStep
protected ThreadLocal<com.google.common.util.concurrent.AtomicDouble> currentThreshold
protected ThreadLocal<AtomicBoolean> bitmapMode
public EncodingHandler()
public EncodingHandler(double threshold)
threshold
- Initial encoding thresholdpublic EncodingHandler(double threshold, Double boundary)
threshold
- Initial encoding thresholdpublic EncodingHandler(double threshold, double minThreshold, double thresholdStep, double stepTrigger, int stepDelay, int shakeFrequency)
threshold
- Initial encoding thresholdminThreshold
- Minimal encoding threshold (for threshold decay)thresholdStep
- Decay step for threshold decaystepTrigger
- Sparse/Dense ratio that will trigger decay step. In range 0..100stepDelay
- Minimal number of iterations between decay stepsshakeFrequency
- How ofter we'll be sending dense updates with lower thresholdpublic EncodingHandler(double threshold, double minThreshold, double thresholdStep, double stepTrigger, int stepDelay, int shakeFrequency, Double boundary)
threshold
- Initial encoding thresholdminThreshold
- Minimal encoding threshold (for threshold decay)thresholdStep
- Decay step for threshold decaystepTrigger
- Sparse/Dense ratio that will trigger decay step. In range 0..100stepDelay
- Minimal number of iterations between decay stepsshakeFrequency
- How ofter we'll be sending dense updates with lower thresholdboundary
- public void initialize(@NonNull GradientsAccumulator accumulator)
MessageHandler
initialize
in interface MessageHandler
public org.nd4j.linalg.api.ndarray.INDArray encodeUpdates(org.nd4j.linalg.api.ndarray.INDArray updates)
@Deprecated public org.nd4j.linalg.api.ndarray.INDArray decodeUpdates(org.nd4j.linalg.api.ndarray.INDArray message)
protected void sendMessage(org.nd4j.linalg.api.ndarray.INDArray message)
message
- public boolean broadcastUpdates(org.nd4j.linalg.api.ndarray.INDArray updates)
MessageHandler
broadcastUpdates
in interface MessageHandler
Copyright © 2017. All rights reserved.