public class CosineSimilarity extends BaseAccumulation
applyFinalTransform, finalResult, finalResultComplexextraArgs, n, numProcessed, passThrough, x, y, z| Constructor and Description |
|---|
CosineSimilarity() |
CosineSimilarity(INDArray x) |
CosineSimilarity(INDArray x,
INDArray y) |
CosineSimilarity(INDArray x,
INDArray y,
INDArray z,
int n) |
CosineSimilarity(INDArray x,
INDArray y,
int n) |
| Modifier and Type | Method and Description |
|---|---|
double |
calculateFinalResult(double accum,
int n)
Calculate the final result.
|
float |
calculateFinalResult(float accum,
int n) |
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().
|
String |
name()
The name of this operation
|
double |
op(double origin,
double other)
Pairwise op (applicable with an individual element in y)
|
float |
op(float origin,
float other)
Pairwise op (applicable with an individual element in y)
|
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)
|
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.
|
applyFinalTransform, combineSubResults, combineSubResults, combineSubResults, currentResult, getFinalResult, getFinalResultComplex, init, numProcessed, op, op, op, setApplyFinalTransform, setFinalResult, setFinalResultComplex, zeroComplex, zeroDouble, zeroFloatensureProperVectors, extraArgs, isPassThrough, n, setN, setX, setY, setZ, toString, x, y, zpublic CosineSimilarity()
public CosineSimilarity(INDArray x)
public double update(double accum,
double x)
Accumulationaccum - The current accumulation valuex - The next/new value to be processed/accumulatedpublic double update(double accum,
double x,
double y)
Accumulationaccum - 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)
AccumulationAccumulation.update(double, double)public IComplexNumber update(IComplexNumber accum, double x, double y)
Accumulationpublic IComplexNumber update(IComplexNumber accum, IComplexNumber x)
AccumulationAccumulation.update(double, double)public IComplexNumber update(IComplexNumber accum, IComplexNumber x, IComplexNumber y)
Accumulationpublic IComplexNumber update(IComplexNumber accum, IComplexNumber x, double y)
Accumulationpublic String name()
Oppublic IComplexNumber op(IComplexNumber origin, double other)
Opop in interface Opop in class BaseAccumulationorigin - the origin numberother - the other numberpublic IComplexNumber op(IComplexNumber origin, float other)
Opop in interface Opop in class BaseAccumulationorigin - the origin numberother - the other numberpublic IComplexNumber op(IComplexNumber origin, IComplexNumber other)
Opop in interface Opop in class BaseAccumulationorigin - the origin numberother - the other numberpublic float op(float origin,
float other)
Opop in interface Opop in class BaseAccumulationorigin - the origin numberother - the other numberpublic double op(double origin,
double other)
Opop in interface Opop in class BaseAccumulationorigin - the origin numberother - the other numberpublic Op opForDimension(int index, int dimension)
Opindex - the index of the op to iterate overdimension - the dimension to ge the input forpublic Op opForDimension(int index, int... dimension)
Opindex - the index of the op to iterate overdimension - the dimension to ge the input forpublic void exec()
Oppublic void exec(int... dimension)
Oppublic double getAndSetFinalResult(double accum)
AccumulationgetAndSetFinalResult in interface AccumulationgetAndSetFinalResult in class BaseAccumulationaccum - The accumulated resultpublic float getAndSetFinalResult(float accum)
getAndSetFinalResult in interface AccumulationgetAndSetFinalResult in class BaseAccumulationAccumulation.getAndSetFinalResult(double)public IComplexNumber getAndSetFinalResult(IComplexNumber accum)
AccumulationgetAndSetFinalResult in interface AccumulationgetAndSetFinalResult in class BaseAccumulationAccumulation.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 AccumulationcalculateFinalResult in class BaseAccumulationaccum - The accumulated resultn - the number of elements accumulatedpublic float calculateFinalResult(float accum,
int n)
calculateFinalResult in interface AccumulationcalculateFinalResult in class BaseAccumulationAccumulation.calculateFinalResult(double, int)Copyright © 2016. All Rights Reserved.