Class BasicInferenceObservable
- java.lang.Object
-
- java.util.Observable
-
- org.deeplearning4j.parallelism.inference.observers.BasicInferenceObservable
-
- All Implemented Interfaces:
InferenceObservable
- Direct Known Subclasses:
BatchedInferenceObservable
public class BasicInferenceObservable extends Observable implements InferenceObservable
-
-
Constructor Summary
Constructors Constructor Description BasicInferenceObservable(org.nd4j.linalg.api.ndarray.INDArray... inputs)
BasicInferenceObservable(org.nd4j.linalg.api.ndarray.INDArray[] inputs, org.nd4j.linalg.api.ndarray.INDArray[] inputMasks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInput(@NonNull org.nd4j.linalg.api.ndarray.INDArray... input)
void
addInput(@NonNull org.nd4j.linalg.api.ndarray.INDArray[] input, org.nd4j.linalg.api.ndarray.INDArray[] inputMasks)
protected void
checkOutputException()
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()
void
setOutputBatches(@NonNull List<org.nd4j.linalg.api.ndarray.INDArray[]> output)
void
setOutputException(Exception exception)
-
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
addObserver
-
-
-
-
Field Detail
-
exception
protected Exception exception
-
-
Method Detail
-
addInput
public void addInput(@NonNull @NonNull org.nd4j.linalg.api.ndarray.INDArray... input)
- Specified by:
addInput
in interfaceInferenceObservable
-
addInput
public void addInput(@NonNull @NonNull org.nd4j.linalg.api.ndarray.INDArray[] input, org.nd4j.linalg.api.ndarray.INDArray[] inputMasks)
- Specified by:
addInput
in interfaceInferenceObservable
-
setOutputBatches
public void setOutputBatches(@NonNull @NonNull List<org.nd4j.linalg.api.ndarray.INDArray[]> output)
- Specified by:
setOutputBatches
in interfaceInferenceObservable
-
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:InferenceObservable
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). In these "can't batch" cases, multiple input batches will be returned, to be processed- Specified by:
getInputBatches
in interfaceInferenceObservable
- Returns:
- List of pairs of input arrays and input mask arrays. Input mask arrays may be null.
-
setOutputException
public void setOutputException(Exception exception)
- Specified by:
setOutputException
in interfaceInferenceObservable
-
getOutput
public org.nd4j.linalg.api.ndarray.INDArray[] getOutput()
- Specified by:
getOutput
in interfaceInferenceObservable
-
checkOutputException
protected void checkOutputException()
-
-