public interface Accumulation extends Op
Modifier and Type | Method and Description |
---|---|
boolean |
applyFinalTransform()
Whether to apply the final
transform or not
|
double |
calculateFinalResult(double accum,
long n)
Calculate the final result.
|
float |
calculateFinalResult(float accum,
long n) |
double |
combineSubResults(double first,
double second)
Combine sub-results, when the Accumulation operation is split and executed in
parallel.
Sometimes this is the same as the update operation (i.e., in sum operation), but often it is not (for example, in L2 norm, sqrt(1/n * sum_i x_i^2). |
float |
combineSubResults(float first,
float second) |
IComplexNumber |
combineSubResults(IComplexNumber first,
IComplexNumber second) |
Number |
currentResult()
Deprecated.
|
double |
getAndSetFinalResult(double accum)
Get and set the final result.
The final result is also stored in the Accumulation op itself (and can be retrieved by getFinalResult()) In some Accumulation operations, a final operation must be done on the accumulated result. |
float |
getAndSetFinalResult(float accum) |
IComplexNumber |
getAndSetFinalResult(IComplexNumber accum)
Complex version of getAndSetFinalResult().
|
Number |
getFinalResult()
Get the final result (may return null if getAndSetFinalResult has not
been called, or for accumulation ops on complex arrays)
|
IComplexNumber |
getFinalResultComplex() |
boolean |
isComplexAccumulation()
This method is only used for Distance functions
|
INDArray |
noOp()
Returns the no op version
of the input
Basically when a reduce can't happen (eg: sum(0) on a row vector)
you have a no op state for a given reduction.
|
IComplexNumber |
op(IComplexNumber origin)
Transform an individual element
|
IComplexNumber |
op(IComplexNumber origin,
double other)
Pairwise op (applicable with an individual element in y)
|
IComplexNumber |
op(IComplexNumber origin,
float other)
Pairwise op (applicable with an individual element in y)
|
IComplexNumber |
op(IComplexNumber origin,
IComplexNumber other)
Pairwise op (applicable with an individual element in y)
|
void |
setApplyFinalTransform(boolean applyFinalTransform)
Setter for final transform
|
void |
setFinalResult(Number number) |
void |
setFinalResultComplex(IComplexNumber number) |
double |
update(double accum,
double x)
Do one accumulation update for a single-argument accumulation, given the
current accumulation value and another value to be processed/accumulated
|
double |
update(double accum,
double x,
double y)
Do an accumulation update for a pair-wise (op(x,y)) accumulation, given the
current accumulation value and a pair of values to be processed/accumulated
|
float |
update(float accum,
float x) |
float |
update(float accum,
float x,
float y) |
IComplexNumber |
update(IComplexNumber accum,
double x)
Complex update.
|
IComplexNumber |
update(IComplexNumber accum,
double x,
double y)
Complex update.
|
IComplexNumber |
update(IComplexNumber accum,
IComplexNumber x)
Complex update.
|
IComplexNumber |
update(IComplexNumber accum,
IComplexNumber x,
double y)
Complex update.
|
IComplexNumber |
update(IComplexNumber accum,
IComplexNumber x,
IComplexNumber y)
Complex update.
|
IComplexNumber |
zeroComplex()
Complex initial value
|
double |
zeroDouble()
Initial value (used to initialize the accumulation op)
|
float |
zeroFloat()
Initial value (used to initialize the accumulation op)
|
float |
zeroHalf()
Initial value for half
|
exec, exec, extraArgs, extraArgsBuff, extraArgsDataBuff, init, isExecSpecial, isPassThrough, n, name, numProcessed, op, op, op, op, opForDimension, opForDimension, opNum, setExtraArgs, setN, setX, setY, setZ, x, y, z
INDArray noOp()
void setApplyFinalTransform(boolean applyFinalTransform)
applyFinalTransform
- boolean applyFinalTransform()
double update(double accum, double x)
accum
- The current accumulation valuex
- The next/new value to be processed/accumulateddouble update(double accum, double x, double y)
accum
- The current accumulation valuex
- The next/new x value to be processed/accumulatedy
- The next/new y value to be processed/accumulatedfloat update(float accum, float x)
update(double, double)
float update(float accum, float x, float y)
update(double, double, double)
IComplexNumber update(IComplexNumber accum, double x)
update(double, double)
IComplexNumber update(IComplexNumber accum, double x, double y)
update(double, double, double)
IComplexNumber update(IComplexNumber accum, IComplexNumber x)
update(double, double)
IComplexNumber update(IComplexNumber accum, IComplexNumber x, IComplexNumber y)
update(double, double, double)
IComplexNumber update(IComplexNumber accum, IComplexNumber x, double y)
update(double, double, double)
double combineSubResults(double first, double second)
first
- The first sub-value to be combinedsecond
- The second sub-value to be combinedfloat combineSubResults(float first, float second)
combineSubResults(double, double)
IComplexNumber combineSubResults(IComplexNumber first, IComplexNumber second)
combineSubResults(double, double)
double getAndSetFinalResult(double accum)
accum
- The accumulated resultfloat getAndSetFinalResult(float accum)
getAndSetFinalResult(double)
IComplexNumber getAndSetFinalResult(IComplexNumber accum)
getAndSetFinalResult(double)
Number getFinalResult()
@Deprecated Number currentResult()
getFinalResult()
, maintained to avoid breaking
implementations created before Accumulation ops were refactored.
May be removed in a future release.IComplexNumber getFinalResultComplex()
void setFinalResult(Number number)
void setFinalResultComplex(IComplexNumber number)
double calculateFinalResult(double accum, long n)
getAndSetFinalResult(double)
, the result is
merely calculated and returned, not stored in the Accumulation op itself.accum
- The accumulated resultn
- the number of elements accumulatedfloat calculateFinalResult(float accum, long n)
calculateFinalResult(double, long)
IComplexNumber op(IComplexNumber origin, double other)
Op
IComplexNumber op(IComplexNumber origin, float other)
Op
IComplexNumber op(IComplexNumber origin, IComplexNumber other)
Op
IComplexNumber op(IComplexNumber origin)
Op
double zeroDouble()
float zeroFloat()
float zeroHalf()
IComplexNumber zeroComplex()
boolean isComplexAccumulation()
Copyright © 2017. All rights reserved.