public abstract class BaseAccumulation extends BaseOp implements Accumulation
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
applyFinalTransform |
protected Number |
finalResult |
protected IComplexNumber |
finalResultComplex |
extraArgs, n, numProcessed, passThrough, x, y, z| Constructor and Description |
|---|
BaseAccumulation() |
BaseAccumulation(INDArray x) |
BaseAccumulation(INDArray x,
INDArray y) |
BaseAccumulation(INDArray x,
INDArray y,
INDArray z,
long n)
Initialize with the given
input, pairwise transform, result, and number
of elements
|
BaseAccumulation(INDArray x,
INDArray y,
long n) |
| 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()
Essentially identical to
Accumulation.getFinalResult(), maintained to avoid breaking
implementations created before Accumulation ops were refactored. |
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() |
void |
init(INDArray x,
INDArray y,
INDArray z,
long n)
Initialize the operation based on the parameters
|
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.
|
long |
numProcessed()
Number processed
|
double |
op(double origin)
Transform an individual element
|
double |
op(double origin,
double other)
Pairwise op (applicable with an individual element in y)
|
float |
op(float origin)
Transform an individual element
|
float |
op(float origin,
float other)
Pairwise op (applicable with an individual element in y)
|
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) |
void |
setZ(INDArray z)
set z (the solution ndarray)
|
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)
|
exec, exec, extraArgs, extraArgsBuff, extraArgsDataBuff, isExecSpecial, isPassThrough, n, setN, setX, setY, toString, x, y, zclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitupdate, update, update, update, update, update, update, update, updateexec, exec, extraArgs, extraArgsBuff, extraArgsDataBuff, isExecSpecial, isPassThrough, n, name, opForDimension, opForDimension, opNum, setN, setX, setY, x, y, zprotected Number finalResult
protected IComplexNumber finalResultComplex
protected boolean applyFinalTransform
public BaseAccumulation()
public BaseAccumulation(INDArray x, INDArray y, INDArray z, long n)
x - the inputy - the pairwise transformz - the resultn - the number of elementspublic BaseAccumulation(INDArray x)
public INDArray noOp()
AccumulationnoOp in interface Accumulationpublic boolean applyFinalTransform()
AccumulationapplyFinalTransform in interface Accumulationpublic void setApplyFinalTransform(boolean applyFinalTransform)
AccumulationsetApplyFinalTransform in interface Accumulationpublic IComplexNumber op(IComplexNumber origin, double other)
Opop in interface Accumulationop in interface Oporigin - the origin numberother - the other numberpublic IComplexNumber op(IComplexNumber origin, float other)
Opop in interface Accumulationop in interface Oporigin - the origin numberother - the other numberpublic IComplexNumber op(IComplexNumber origin, IComplexNumber other)
Opop in interface Accumulationop in interface Oporigin - the origin numberother - the other numberpublic float op(float origin,
float other)
Oppublic double op(double origin,
double other)
Oppublic double op(double origin)
Oppublic float op(float origin)
Oppublic IComplexNumber op(IComplexNumber origin)
Opop in interface Accumulationop in interface Oporigin - the origin elementpublic double zeroDouble()
AccumulationzeroDouble in interface Accumulationpublic float zeroFloat()
AccumulationzeroFloat in interface Accumulationpublic IComplexNumber zeroComplex()
AccumulationzeroComplex in interface Accumulationpublic long numProcessed()
OpnumProcessed in interface OpnumProcessed in class BaseOppublic void init(INDArray x, INDArray y, INDArray z, long n)
Oppublic double combineSubResults(double first,
double second)
AccumulationcombineSubResults in interface Accumulationfirst - The first sub-value to be combinedsecond - The second sub-value to be combinedpublic float combineSubResults(float first,
float second)
combineSubResults in interface AccumulationAccumulation.combineSubResults(double, double)public IComplexNumber combineSubResults(IComplexNumber first, IComplexNumber second)
combineSubResults in interface AccumulationAccumulation.combineSubResults(double, double)public double getAndSetFinalResult(double accum)
AccumulationgetAndSetFinalResult in interface Accumulationaccum - The accumulated resultpublic float getAndSetFinalResult(float accum)
getAndSetFinalResult in interface AccumulationAccumulation.getAndSetFinalResult(double)public IComplexNumber getAndSetFinalResult(IComplexNumber accum)
AccumulationgetAndSetFinalResult in interface AccumulationAccumulation.getAndSetFinalResult(double)public double calculateFinalResult(double accum,
long n)
AccumulationAccumulation.getAndSetFinalResult(double), the result is
merely calculated and returned, not stored in the Accumulation op itself.calculateFinalResult in interface Accumulationaccum - The accumulated resultn - the number of elements accumulatedpublic float calculateFinalResult(float accum,
long n)
calculateFinalResult in interface Accumulation#calculateFinalResult(double, int)public Number currentResult()
AccumulationAccumulation.getFinalResult(), maintained to avoid breaking
implementations created before Accumulation ops were refactored.
May be removed in a future release.currentResult in interface Accumulationpublic void setFinalResult(Number number)
setFinalResult in interface Accumulationpublic void setFinalResultComplex(IComplexNumber number)
setFinalResultComplex in interface Accumulationpublic Number getFinalResult()
AccumulationgetFinalResult in interface Accumulationpublic IComplexNumber getFinalResultComplex()
getFinalResultComplex in interface AccumulationCopyright © 2016. All Rights Reserved.