Class BatchedInferenceObservable
- java.lang.Object
-
- java.util.Observable
-
- org.deeplearning4j.parallelism.inference.observers.BasicInferenceObservable
-
- org.deeplearning4j.parallelism.inference.observers.BatchedInferenceObservable
-
- All Implemented Interfaces:
InferenceObservable
public class BatchedInferenceObservable extends BasicInferenceObservable implements InferenceObservable
-
-
Field Summary
-
Fields inherited from class org.deeplearning4j.parallelism.inference.observers.BasicInferenceObservable
exception
-
-
Constructor Summary
Constructors Constructor Description BatchedInferenceObservable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInput(org.nd4j.linalg.api.ndarray.INDArray[] input, org.nd4j.linalg.api.ndarray.INDArray[] inputMasks)intgetCounter()List<org.nd4j.common.primitives.Pair<org.nd4j.linalg.api.ndarray.INDArray[],org.nd4j.linalg.api.ndarray.INDArray[]>>getInputBatches()Get input batches - and their associated input mask arrays, if any
Note that usually the returned list will be of size 1 - however, in the batched case, not all inputs can actually be batched (variable size inputs to fully convolutional net, for example).org.nd4j.linalg.api.ndarray.INDArray[]getOutput()protected List<org.nd4j.linalg.api.ndarray.INDArray[]>getOutputs()PLEASE NOTE: This method is for tests onlybooleanisLocked()protected voidsetCounter(int value)voidsetOutputBatches(List<org.nd4j.linalg.api.ndarray.INDArray[]> output)voidsetPosition(int pos)-
Methods inherited from class org.deeplearning4j.parallelism.inference.observers.BasicInferenceObservable
addInput, checkOutputException, setOutputException
-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.deeplearning4j.parallelism.inference.InferenceObservable
addInput, addObserver, setOutputException
-
-
-
-
Method Detail
-
addInput
public void addInput(org.nd4j.linalg.api.ndarray.INDArray[] input, org.nd4j.linalg.api.ndarray.INDArray[] inputMasks)- Specified by:
addInputin interfaceInferenceObservable- Overrides:
addInputin classBasicInferenceObservable
-
getInputBatches
public List<org.nd4j.common.primitives.Pair<org.nd4j.linalg.api.ndarray.INDArray[],org.nd4j.linalg.api.ndarray.INDArray[]>> getInputBatches()
Description copied from interface:InferenceObservableGet input batches - and their associated input mask arrays, if any
Note that usually the returned list will be of size 1 - however, in the batched case, not all inputs can actually be batched (variable size inputs to fully convolutional net, for example). In these "can't batch" cases, multiple input batches will be returned, to be processed- Specified by:
getInputBatchesin interfaceInferenceObservable- Overrides:
getInputBatchesin classBasicInferenceObservable- Returns:
- List of pairs of input arrays and input mask arrays. Input mask arrays may be null.
-
setOutputBatches
public void setOutputBatches(List<org.nd4j.linalg.api.ndarray.INDArray[]> output)
- Specified by:
setOutputBatchesin interfaceInferenceObservable- Overrides:
setOutputBatchesin classBasicInferenceObservable
-
getOutputs
protected List<org.nd4j.linalg.api.ndarray.INDArray[]> getOutputs()
PLEASE NOTE: This method is for tests only- Returns:
-
setCounter
protected void setCounter(int value)
-
setPosition
public void setPosition(int pos)
-
getCounter
public int getCounter()
-
isLocked
public boolean isLocked()
-
getOutput
public org.nd4j.linalg.api.ndarray.INDArray[] getOutput()
- Specified by:
getOutputin interfaceInferenceObservable- Overrides:
getOutputin classBasicInferenceObservable
-
-