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,
int n)
Initialize with the given
input, pairwise transform, result, and number
of elements
|
BaseAccumulation(INDArray x,
INDArray y,
int n) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
applyFinalTransform()
Whether to apply the final
transform or not
|
double |
calculateFinalResult(double accum,
int n)
Calculate the final result.
|
float |
calculateFinalResult(float accum,
int 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,
int n)
Initialize the operation based on the parameters
|
int |
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) |
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)
|
ensureProperVectors, exec, exec, extraArgs, isPassThrough, n, setN, setX, setY, setZ, toString, x, y, zclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprotected Number finalResult
protected IComplexNumber finalResultComplex
protected boolean applyFinalTransform
public BaseAccumulation()
public BaseAccumulation(INDArray x, INDArray y, INDArray z, int n)
x - the inputy - the pairwise transformz - the resultn - the number of elementspublic BaseAccumulation(INDArray x)
public boolean applyFinalTransform()
AccumulationapplyFinalTransform in interface Accumulationpublic void setApplyFinalTransform(boolean applyFinalTransform)
AccumulationsetApplyFinalTransform in interface Accumulationpublic IComplexNumber op(IComplexNumber origin, double other)
Oppublic IComplexNumber op(IComplexNumber origin, float other)
Oppublic IComplexNumber op(IComplexNumber origin, IComplexNumber other)
Oppublic 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)
Oppublic double zeroDouble()
AccumulationzeroDouble in interface Accumulationpublic float zeroFloat()
AccumulationzeroFloat in interface Accumulationpublic IComplexNumber zeroComplex()
AccumulationzeroComplex in interface Accumulationpublic int numProcessed()
OpnumProcessed in interface OpnumProcessed in class BaseOppublic void init(INDArray x, INDArray y, INDArray z, int 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,
int 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,
int n)
calculateFinalResult in interface AccumulationAccumulation.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.