public class Variance extends BaseAccumulation
Modifier and Type | Field and Description |
---|---|
protected double |
bias |
protected boolean |
biasCorrected |
protected double |
mean |
finalResult, finalResultComplex
extraArgs, n, numProcessed, passThrough, x, y, z
Constructor and Description |
---|
Variance() |
Variance(INDArray x) |
Variance(INDArray x,
boolean biasCorrected) |
Variance(INDArray x,
INDArray y) |
Variance(INDArray x,
INDArray y,
boolean biasCorrected) |
Variance(INDArray x,
INDArray y,
INDArray z,
int n) |
Variance(INDArray x,
INDArray y,
INDArray z,
int n,
boolean biasCorrected) |
Variance(INDArray x,
INDArray y,
int n) |
Variance(INDArray x,
INDArray y,
int n,
boolean biasCorrected) |
Modifier and Type | Method and Description |
---|---|
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) |
void |
exec()
Execute the op if its pass through (not needed most of the time)
|
void |
exec(int... dimension)
Exec along each dimension
|
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().
|
void |
init(INDArray x,
INDArray y,
INDArray z,
int n)
Initialize the operation based on the parameters
|
String |
name()
The name of this operation
|
Op |
opForDimension(int index,
int... dimension)
A copy of this operation for a particular dimension of the input
|
Op |
opForDimension(int index,
int dimension)
A copy of this operation for a particular dimension of the input
|
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.
|
currentResult, getFinalResult, getFinalResultComplex, numProcessed, op, op, op, op, op, op, op, op, setFinalResult, setFinalResultComplex, zeroComplex, zeroDouble, zeroFloat
ensureProperVectors, extraArgs, isPassThrough, n, setX, setY, setZ, toString, x, y, z
protected double mean
protected double bias
protected boolean biasCorrected
public Variance()
public Variance(INDArray x)
public Variance(INDArray x, boolean biasCorrected)
public double update(double accum, double x)
Accumulation
accum
- The current accumulation valuex
- The next/new value to be processed/accumulatedpublic double update(double accum, double x, double y)
Accumulation
accum
- The current accumulation valuex
- The next/new x value to be processed/accumulatedy
- The next/new y value to be processed/accumulatedpublic float update(float accum, float x)
Accumulation.update(double, double)
public float update(float accum, float x, float y)
public IComplexNumber update(IComplexNumber accum, double x)
Accumulation
Accumulation.update(double, double)
public IComplexNumber update(IComplexNumber accum, double x, double y)
Accumulation
public IComplexNumber update(IComplexNumber accum, IComplexNumber x)
Accumulation
Accumulation.update(double, double)
public IComplexNumber update(IComplexNumber accum, IComplexNumber x, IComplexNumber y)
Accumulation
public IComplexNumber update(IComplexNumber accum, IComplexNumber x, double y)
Accumulation
public String name()
Op
public Op opForDimension(int index, int dimension)
Op
index
- the index of the op to iterate overdimension
- the dimension to ge the input forpublic Op opForDimension(int index, int... dimension)
Op
index
- the index of the op to iterate overdimension
- the dimension to ge the input forpublic void init(INDArray x, INDArray y, INDArray z, int n)
Op
init
in interface Op
init
in class BaseAccumulation
x
- the inputy
- the pairwise transform ndarrayz
- the resulting ndarrayn
- the number of elementspublic void exec()
Op
public void exec(int... dimension)
Op
public double combineSubResults(double first, double second)
Accumulation
combineSubResults
in interface Accumulation
combineSubResults
in class BaseAccumulation
first
- The first sub-value to be combinedsecond
- The second sub-value to be combinedpublic float combineSubResults(float first, float second)
combineSubResults
in interface Accumulation
combineSubResults
in class BaseAccumulation
Accumulation.combineSubResults(double, double)
public IComplexNumber combineSubResults(IComplexNumber first, IComplexNumber second)
combineSubResults
in interface Accumulation
combineSubResults
in class BaseAccumulation
Accumulation.combineSubResults(double, double)
public double getAndSetFinalResult(double accum)
Accumulation
getAndSetFinalResult
in interface Accumulation
getAndSetFinalResult
in class BaseAccumulation
accum
- The accumulated resultpublic float getAndSetFinalResult(float accum)
getAndSetFinalResult
in interface Accumulation
getAndSetFinalResult
in class BaseAccumulation
Accumulation.getAndSetFinalResult(double)
public IComplexNumber getAndSetFinalResult(IComplexNumber accum)
Accumulation
getAndSetFinalResult
in interface Accumulation
getAndSetFinalResult
in class BaseAccumulation
Accumulation.getAndSetFinalResult(double)
public double calculateFinalResult(double accum, int n)
Accumulation
Accumulation.getAndSetFinalResult(double)
, the result is
merely calculated and returned, not stored in the Accumulation op itself.calculateFinalResult
in interface Accumulation
calculateFinalResult
in class BaseAccumulation
accum
- The accumulated resultn
- the number of elements accumulatedpublic float calculateFinalResult(float accum, int n)
calculateFinalResult
in interface Accumulation
calculateFinalResult
in class BaseAccumulation
Accumulation.calculateFinalResult(double, int)
Copyright © 2015. All Rights Reserved.