public class NDMath extends Object
Constructor and Description |
---|
NDMath() |
Modifier and Type | Method and Description |
---|---|
INDArray |
abs(INDArray x)
Elementwise absolute value operation: out = abs(x)
|
INDArray |
acos(INDArray x)
Elementwise acos (arccosine, inverse cosine) operation: out = arccos(x)
|
INDArray |
acosh(INDArray x)
Elementwise acosh (inverse hyperbolic cosine) function: out = acosh(x)
|
INDArray |
amax(INDArray in,
int... dimensions)
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))
|
INDArray |
amean(INDArray in,
int... dimensions)
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))
|
INDArray |
amin(INDArray in,
int... dimensions)
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))
|
INDArray |
and(INDArray x,
INDArray y)
Boolean AND operation: elementwise (x != 0) && (y != 0)
If x and y arrays have equal shape, the output shape is the same as these inputs. Note: supports broadcasting if x and y have different shapes and are broadcastable. Returns an array with values 1 where condition is satisfied, or value 0 otherwise. |
INDArray |
asin(INDArray x)
Elementwise asin (arcsin, inverse sine) operation: out = arcsin(x)
|
INDArray |
asinh(INDArray x)
Elementwise asinh (inverse hyperbolic sine) function: out = asinh(x)
|
INDArray |
asum(INDArray in,
int... dimensions)
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))
|
INDArray |
atan(INDArray x)
Elementwise atan (arctangent, inverse tangent) operation: out = arctangent(x)
|
INDArray |
atan2(INDArray y,
INDArray x)
Elementwise atan (arctangent, inverse tangent) operation: out = atan2(x,y).
Similar to atan(y/x) but sigts of x and y are used to determine the location of the result |
INDArray |
atanh(INDArray x)
Elementwise atanh (inverse hyperbolic tangent) function: out = atanh(x)
|
INDArray |
ceil(INDArray x)
Element-wise ceiling function: out = ceil(x).
Rounds each value up to the nearest integer value (if not already an integer) |
INDArray |
clipByNorm(INDArray x,
double clipValue,
int... dimensions)
Clipping by L2 norm, optionally along dimension(s)
if l2Norm(x,dimension) < clipValue, then input is returned unmodifed Otherwise, out[i] = in[i] * clipValue / l2Norm(in, dimensions) where each value is clipped according to the corresponding l2Norm along the specified dimensions |
INDArray |
clipByValue(INDArray x,
double clipValueMin,
double clipValueMax)
Element-wise clipping function:
out[i] = in[i] if in[i] >= clipValueMin and in[i] <= clipValueMax out[i] = clipValueMin if in[i] < clipValueMin out[i] = clipValueMax if in[i] > clipValueMax |
INDArray |
confusionMatrix(INDArray labels,
INDArray pred,
DataType dataType)
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values. |
INDArray |
confusionMatrix(INDArray labels,
INDArray pred,
INDArray weights)
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values. |
INDArray |
confusionMatrix(INDArray labels,
INDArray pred,
INDArray weights,
int numClasses)
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values. For example, if labels = [0, 1, 1], predicted = [0, 2, 1], numClasses = 4, and weights = [1, 2, 3] [1, 0, 0, 0] [0, 3, 2, 0] [0, 0, 0, 0] [0, 0, 0, 0] |
INDArray |
confusionMatrix(INDArray labels,
INDArray pred,
int numClasses)
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values. For example, if labels = [0, 1, 1], predicted = [0, 2, 1], and numClasses=4 then output is: [1, 0, 0, 0] [0, 1, 1, 0] [0, 0, 0, 0] [0, 0, 0, 0] |
INDArray |
cos(INDArray x)
Elementwise cosine operation: out = cos(x)
|
INDArray |
cosh(INDArray x)
Elementwise cosh (hyperbolic cosine) operation: out = cosh(x)
|
INDArray |
cosineDistance(INDArray x,
INDArray y,
int... dimensions)
Cosine distance reduction operation.
|
INDArray |
cosineSimilarity(INDArray x,
INDArray y,
int... dimensions)
Cosine similarity pairwise reduction operation.
|
INDArray |
countNonZero(INDArray in,
int... dimensions)
Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)
|
INDArray |
countZero(INDArray in,
int... dimensions)
Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)
|
INDArray |
cross(INDArray a,
INDArray b)
Returns the pair-wise cross product of equal size arrays a and b: a x b = ||a||x||b|| sin(theta).
Can take rank 1 or above inputs (of equal shapes), but note that the last dimension must have dimension 3 |
INDArray |
cube(INDArray x)
Element-wise cube function: out = x^3
|
INDArray |
diag(INDArray x)
Returns an output variable with diagonal values equal to the specified values; off-diagonal values will be set to 0
For example, if input = [1,2,3], then output is given by: [ 1, 0, 0] [ 0, 2, 0] [ 0, 0, 3] Higher input ranks are also supported: if input has shape [a,...,R-1] then output[i,...,k,i,...,k] = input[i,...,k]. i.e., for input rank R, output has rank 2R |
INDArray |
diagPart(INDArray x)
Extract the diagonal part from the input array.
If input is [ 1, 0, 0] [ 0, 2, 0] [ 0, 0, 3] then output is [1, 2, 3]. Supports higher dimensions: in general, out[i,...,k] = in[i,...,k,i,...,k] |
INDArray |
entropy(INDArray in,
int... dimensions)
Entropy reduction: -sum(x * log(x))
|
INDArray |
erf(INDArray x)
Element-wise Gaussian error function - out = erf(in)
|
INDArray |
erfc(INDArray x)
Element-wise complementary Gaussian error function - out = erfc(in) = 1 - erf(in)
|
INDArray |
euclideanDistance(INDArray x,
INDArray y,
int... dimensions)
Euclidean distance (l2 norm, l2 distance) reduction operation.
|
INDArray |
exp(INDArray x)
Elementwise exponent function: out = exp(x) = 2.71828...^x
|
INDArray |
expm1(INDArray x)
Elementwise 1.0 - exponent function: out = 1.0 - exp(x) = 1.0 - 2.71828...^x
|
INDArray |
eye(INDArray rows)
As per eye(String, int) but with the number of rows specified as a scalar INDArray
|
INDArray |
eye(INDArray rows,
INDArray cols)
As per eye(int, int) bit with the number of rows/columns specified as scalar INDArrays
|
INDArray |
eye(int rows)
Generate an identity matrix with the specified number of rows and columns.
|
INDArray |
eye(int rows,
int cols)
As per eye(String, int, int, DataType) but with the default datatype, Eye.DEFAULT_DTYPE
|
INDArray |
eye(int rows,
int cols,
DataType dataType)
Generate an identity matrix with the specified number of rows and columns
Example: |
INDArray |
firstIndex(INDArray in,
Condition condition,
boolean keepDims,
int... dimensions)
First index reduction operation.
Returns a variable that contains the index of the first element that matches the specified condition (for each slice along the specified dimensions) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
firstIndex(INDArray in,
Condition condition,
int... dimensions)
First index reduction operation.
Returns a variable that contains the index of the first element that matches the specified condition (for each slice along the specified dimensions) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
floor(INDArray x)
Element-wise floor function: out = floor(x).
Rounds each value down to the nearest integer value (if not already an integer) |
INDArray |
hammingDistance(INDArray x,
INDArray y,
int... dimensions)
Hamming distance reduction operation.
|
INDArray |
iamax(INDArray in,
boolean keepDims,
int... dimensions)
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...) |
INDArray |
iamax(INDArray in,
int... dimensions)
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...) |
INDArray |
iamin(INDArray in,
boolean keepDims,
int... dimensions)
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...) |
INDArray |
iamin(INDArray in,
int... dimensions)
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...) |
INDArray |
isFinite(INDArray x)
Is finite operation: elementwise isFinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or value 0 otherwise |
INDArray |
isInfinite(INDArray x)
Is infinite operation: elementwise isInfinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or value 0 otherwise |
INDArray |
isMax(INDArray x)
Is maximum operation: elementwise x == max(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or value 0 otherwise |
INDArray |
isNaN(INDArray x)
Is Not a Number operation: elementwise isNaN(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or value 0 otherwise |
INDArray |
isNonDecreasing(INDArray x)
Is the array non decreasing?
An array is non-decreasing if for every valid i, x[i] <= x[i+1]. |
INDArray |
isStrictlyIncreasing(INDArray x)
Is the array strictly increasing?
An array is strictly increasing if for every valid i, x[i] < x[i+1]. |
INDArray |
jaccardDistance(INDArray x,
INDArray y,
int... dimensions)
Jaccard similarity reduction operation.
|
INDArray |
lastIndex(INDArray in,
Condition condition,
boolean keepDims,
int... dimensions)
Last index reduction operation.
Returns a variable that contains the index of the last element that matches the specified condition (for each slice along the specified dimensions) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
lastIndex(INDArray in,
Condition condition,
int... dimensions)
Last index reduction operation.
Returns a variable that contains the index of the last element that matches the specified condition (for each slice along the specified dimensions) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
log(INDArray x)
Element-wise logarithm function (base e - natural logarithm): out = log(x)
|
INDArray |
log(INDArray x,
INDArray base)
Element-wise logarithm function (with specified base): out = log_{base}(x)
|
INDArray |
log1p(INDArray x)
Elementwise natural logarithm function: out = log_e (1 + x)
|
INDArray |
logEntropy(INDArray in,
int... dimensions)
Log entropy reduction: log(-sum(x * log(x)))
|
INDArray |
logSumExp(INDArray input,
int... dimensions)
Log-sum-exp reduction (optionally along dimension).
Computes log(sum(exp(x)) |
INDArray |
manhattanDistance(INDArray x,
INDArray y,
int... dimensions)
Manhattan distance (l1 norm, l1 distance) reduction operation.
|
INDArray |
matrixDeterminant(INDArray in)
Matrix determinant op.
|
INDArray |
matrixInverse(INDArray in)
Matrix inverse op.
|
INDArray |
mergeAdd(INDArray[] inputs)
Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i] |
INDArray |
mergeAvg(INDArray[] inputs)
Merge average function: merges an arbitrary number of equal shaped arrays using element-wise mean operation:
out = mean_i in[i] |
INDArray |
mergeMax(INDArray[] inputs)
Merge max function: merges an arbitrary number of equal shaped arrays using element-wise maximum operation:
out = max_i in[i] |
INDArray |
moments(INDArray input,
int... axes)
Calculate the mean and (population) variance for the input variable, for the specified axis
|
INDArray |
neg(INDArray x)
Elementwise negative operation: out = -x
|
INDArray |
normalizeMoments(INDArray counts,
INDArray means,
INDArray variances,
double shift)
Calculate the mean and variance from the sufficient statistics
|
INDArray |
or(INDArray x,
INDArray y)
Boolean OR operation: elementwise (x != 0) || (y != 0)
If x and y arrays have equal shape, the output shape is the same as these inputs. Note: supports broadcasting if x and y have different shapes and are broadcastable. Returns an array with values 1 where condition is satisfied, or value 0 otherwise. |
INDArray |
pow(INDArray x,
double value)
Element-wise power function: out = x^value
|
INDArray |
pow(INDArray x,
INDArray y)
Element-wise (broadcastable) power function: out = x[i]^y[i]
|
INDArray |
reciprocal(INDArray x)
Element-wise reciprocal (inverse) function: out[i] = 1 / in[i]
|
INDArray |
round(INDArray x)
Element-wise round function: out = round(x).
Rounds (up or down depending on value) to the nearest integer value. |
INDArray |
rsqrt(INDArray x)
Element-wise reciprocal (inverse) of square root: out = 1.0 / sqrt(x)
|
INDArray |
setDiag(INDArray in,
INDArray diag)
Set the diagonal value to the specified values
If input is [ a, b, c] [ d, e, f] [ g, h, i] and diag = [ 1, 2, 3] then output is [ 1, b, c] [ d, 2, f] [ g, h, 3] |
INDArray |
shannonEntropy(INDArray in,
int... dimensions)
Shannon Entropy reduction: -sum(x * log2(x))
|
INDArray |
sign(INDArray x)
Element-wise sign (signum) function:
out = -1 if in < 0 out = 0 if in = 0 out = 1 if in > 0 |
INDArray |
sin(INDArray x)
Elementwise sine operation: out = sin(x)
|
INDArray |
sinh(INDArray x)
Elementwise sinh (hyperbolic sine) operation: out = sinh(x)
|
INDArray |
sqrt(INDArray x)
Element-wise square root function: out = sqrt(x)
|
INDArray |
square(INDArray x)
Element-wise square function: out = x^2
|
INDArray |
standardize(INDArray x,
int... dimensions)
Standardize input variable along given axis
|
INDArray |
step(INDArray x,
double value)
Elementwise step function:
out(x) = 1 if x >= cutoff out(x) = 0 otherwise |
INDArray |
tan(INDArray x)
Elementwise tangent operation: out = tan(x)
|
INDArray |
tanh(INDArray x)
Elementwise tanh (hyperbolic tangent) operation: out = tanh(x)
|
INDArray |
trace(INDArray in)
Matrix trace operation
For rank 2 matrices, the output is a scalar vith the trace - i.e., sum of the main diagonal. For higher rank inputs, output[a,b,c] = trace(in[a,b,c,:,:]) |
INDArray |
xor(INDArray x,
INDArray y)
Boolean XOR (exclusive OR) operation: elementwise (x != 0) XOR (y != 0)
If x and y arrays have equal shape, the output shape is the same as these inputs. Note: supports broadcasting if x and y have different shapes and are broadcastable. Returns an array with values 1 where condition is satisfied, or value 0 otherwise. |
INDArray |
zeroFraction(INDArray input)
Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))
|
public INDArray abs(INDArray x)
x
- Input variable (NUMERIC type)public INDArray acos(INDArray x)
x
- Input variable (NUMERIC type)public INDArray acosh(INDArray x)
x
- Input variable (NUMERIC type)public INDArray amax(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray amean(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray amin(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray and(INDArray x, INDArray y)
x
- Input 1 (BOOL type)y
- Input 2 (BOOL type)public INDArray asin(INDArray x)
x
- Input variable (NUMERIC type)public INDArray asinh(INDArray x)
x
- Input variable (NUMERIC type)public INDArray asum(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray atan(INDArray x)
x
- Input variable (NUMERIC type)public INDArray atan2(INDArray y, INDArray x)
y
- Input Y variable (NUMERIC type)x
- Input X variable (NUMERIC type)public INDArray atanh(INDArray x)
x
- Input variable (NUMERIC type)public INDArray ceil(INDArray x)
x
- Input variable (NUMERIC type)public INDArray clipByNorm(INDArray x, double clipValue, int... dimensions)
x
- Input variable (NUMERIC type)clipValue
- Clipping value (maximum l2 norm)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray clipByValue(INDArray x, double clipValueMin, double clipValueMax)
x
- Input variable (NUMERIC type)clipValueMin
- Minimum value for clippingclipValueMax
- Maximum value for clippingpublic INDArray confusionMatrix(INDArray labels, INDArray pred, DataType dataType)
labels
- Labels - 1D array of integer values representing label values (NUMERIC type)pred
- Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)dataType
- Data typepublic INDArray confusionMatrix(INDArray labels, INDArray pred, int numClasses)
labels
- Labels - 1D array of integer values representing label values (NUMERIC type)pred
- Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)numClasses
- Number of classespublic INDArray confusionMatrix(INDArray labels, INDArray pred, INDArray weights)
labels
- Labels - 1D array of integer values representing label values (NUMERIC type)pred
- Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)weights
- Weights - 1D array of values (may be real/decimal) representing the weight/contribution of each prediction. Must be same length as both labels and predictions arrays (NUMERIC type)public INDArray confusionMatrix(INDArray labels, INDArray pred, INDArray weights, int numClasses)
labels
- Labels - 1D array of integer values representing label values (NUMERIC type)pred
- Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)weights
- Weights - 1D array of values (may be real/decimal) representing the weight/contribution of each prediction. Must be same length as both labels and predictions arrays (NUMERIC type)numClasses
- public INDArray cos(INDArray x)
x
- Input variable (NUMERIC type)public INDArray cosh(INDArray x)
x
- Input variable (NUMERIC type)public INDArray cosineDistance(INDArray x, INDArray y, int... dimensions)
x
- Input variable x (NUMERIC type)y
- Input variable y (NUMERIC type)dimensions
- Dimensions to calculate cosineDistance over (Size: AtLeast(min=1))public INDArray cosineSimilarity(INDArray x, INDArray y, int... dimensions)
x
- Input variable x (NUMERIC type)y
- Input variable y (NUMERIC type)dimensions
- Dimensions to calculate cosineSimilarity over (Size: AtLeast(min=1))public INDArray countNonZero(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray countZero(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray cross(INDArray a, INDArray b)
a
- First input (NUMERIC type)b
- Second input (NUMERIC type)public INDArray cube(INDArray x)
x
- Input variable (NUMERIC type)public INDArray diag(INDArray x)
x
- Input variable (NUMERIC type)public INDArray diagPart(INDArray x)
x
- Input variable (NUMERIC type)public INDArray entropy(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray erf(INDArray x)
x
- Input variable (NUMERIC type)public INDArray erfc(INDArray x)
x
- Input variable (NUMERIC type)public INDArray euclideanDistance(INDArray x, INDArray y, int... dimensions)
x
- Input variable x (NUMERIC type)y
- Input variable y (NUMERIC type)dimensions
- Dimensions to calculate euclideanDistance over (Size: AtLeast(min=1))public INDArray exp(INDArray x)
x
- Input variable (NUMERIC type)public INDArray expm1(INDArray x)
x
- Input variable (NUMERIC type)public INDArray eye(int rows)
rows
- Number of rowspublic INDArray eye(int rows, int cols)
rows
- Number of rowscols
- Number of columnspublic INDArray eye(int rows, int cols, DataType dataType)
INDArray eye = eye(3,2)<br> eye:<br> [ 1, 0]<br> [ 0, 1]<br> [ 0, 0]
rows
- Number of rowscols
- Number of columnsdataType
- Data typepublic INDArray eye(INDArray rows, INDArray cols)
rows
- Number of rows (INT type)cols
- Number of columns (INT type)public INDArray eye(INDArray rows)
rows
- Number of rows (INT type)public INDArray firstIndex(INDArray in, Condition condition, int... dimensions)
in
- Input variable (NUMERIC type)condition
- Condition to check on input variabledimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray firstIndex(INDArray in, Condition condition, boolean keepDims, int... dimensions)
in
- Input variable (NUMERIC type)condition
- Condition to check on input variablekeepDims
- If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray floor(INDArray x)
x
- Input variable (NUMERIC type)public INDArray hammingDistance(INDArray x, INDArray y, int... dimensions)
x
- Input variable x (NUMERIC type)y
- Input variable y (NUMERIC type)dimensions
- Dimensions to calculate hammingDistance over (Size: AtLeast(min=1))public INDArray iamax(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray iamax(INDArray in, boolean keepDims, int... dimensions)
in
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray iamin(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray iamin(INDArray in, boolean keepDims, int... dimensions)
in
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray isFinite(INDArray x)
x
- Input variable (NUMERIC type)public INDArray isInfinite(INDArray x)
x
- Input variable (NUMERIC type)public INDArray isMax(INDArray x)
x
- Input variable (NUMERIC type)public INDArray isNaN(INDArray x)
x
- Input variable (NUMERIC type)public INDArray isNonDecreasing(INDArray x)
x
- Input variable (NUMERIC type)public INDArray isStrictlyIncreasing(INDArray x)
x
- Input variable (NUMERIC type)public INDArray jaccardDistance(INDArray x, INDArray y, int... dimensions)
x
- Input variable x (NUMERIC type)y
- Input variable y (NUMERIC type)dimensions
- Dimensions to calculate jaccardDistance over (Size: AtLeast(min=1))public INDArray lastIndex(INDArray in, Condition condition, int... dimensions)
in
- Input variable (NUMERIC type)condition
- Condition to check on input variabledimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray lastIndex(INDArray in, Condition condition, boolean keepDims, int... dimensions)
in
- Input variable (NUMERIC type)condition
- Condition to check on input variablekeepDims
- If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray log(INDArray x)
x
- Input variable (NUMERIC type)public INDArray log(INDArray x, INDArray base)
x
- Input variable (NUMERIC type)base
- Logarithm base (NUMERIC type)public INDArray log1p(INDArray x)
x
- Input variable (NUMERIC type)public INDArray logEntropy(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray logSumExp(INDArray input, int... dimensions)
input
- Input variable (NUMERIC type)dimensions
- Optional dimensions to reduce along (Size: AtLeast(min=0))public INDArray manhattanDistance(INDArray x, INDArray y, int... dimensions)
x
- Input variable x (NUMERIC type)y
- Input variable y (NUMERIC type)dimensions
- Dimensions to calculate manhattanDistance over (Size: AtLeast(min=1))public INDArray matrixDeterminant(INDArray in)
in
- Input (NUMERIC type)public INDArray matrixInverse(INDArray in)
in
- Input (NUMERIC type)public INDArray mergeAdd(INDArray[] inputs)
inputs
- Input variables (NUMERIC type)public INDArray mergeAvg(INDArray[] inputs)
inputs
- Input variables (NUMERIC type)public INDArray mergeMax(INDArray[] inputs)
inputs
- Input variables (NUMERIC type)public INDArray moments(INDArray input, int... axes)
input
- Input to calculate moments for (NUMERIC type)axes
- Dimensions to perform calculation over (Size: AtLeast(min=0))public INDArray neg(INDArray x)
x
- Input variable (NUMERIC type)public INDArray normalizeMoments(INDArray counts, INDArray means, INDArray variances, double shift)
counts
- Rank 0 (scalar) value with the total number of values used to calculate the sufficient statistics (NUMERIC type)means
- Mean-value sufficient statistics: this is the SUM of all data values (NUMERIC type)variances
- Variaance sufficient statistics: this is the squared sum of all data values (NUMERIC type)shift
- Shift value, possibly 0, used when calculating the sufficient statistics (for numerical stability)public INDArray or(INDArray x, INDArray y)
x
- Input 1 (BOOL type)y
- Input 2 (BOOL type)public INDArray pow(INDArray x, double value)
x
- Input variable (NUMERIC type)value
- Scalar value for oppublic INDArray pow(INDArray x, INDArray y)
x
- Input variable (NUMERIC type)y
- Power (NUMERIC type)public INDArray reciprocal(INDArray x)
x
- Input variable (NUMERIC type)public INDArray round(INDArray x)
x
- Input variable (NUMERIC type)public INDArray rsqrt(INDArray x)
x
- Input variable (NUMERIC type)public INDArray setDiag(INDArray in, INDArray diag)
in
- Input variable (NUMERIC type)diag
- Diagonal (NUMERIC type)public INDArray shannonEntropy(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))public INDArray sign(INDArray x)
x
- Input variable (NUMERIC type)public INDArray sin(INDArray x)
x
- Input variable (NUMERIC type)public INDArray sinh(INDArray x)
x
- Input variable (NUMERIC type)public INDArray sqrt(INDArray x)
x
- Input variable (NUMERIC type)public INDArray square(INDArray x)
x
- Input variable (NUMERIC type)public INDArray standardize(INDArray x, int... dimensions)
out = (x - mean) / stdev
with mean and stdev being calculated along the given dimension.
For example: given x as a mini batch of the shape [numExamples, exampleLength]:
x
- Input variable (NUMERIC type)dimensions
- (Size: AtLeast(min=1))public INDArray step(INDArray x, double value)
x
- Input variable (NUMERIC type)value
- Scalar value for oppublic INDArray tan(INDArray x)
x
- Input variable (NUMERIC type)public INDArray tanh(INDArray x)
x
- Input variable (NUMERIC type)public INDArray trace(INDArray in)
in
- Input variable (NUMERIC type)public INDArray xor(INDArray x, INDArray y)
x
- Input 1 (BOOL type)y
- Input 2 (BOOL type)Copyright © 2019. All rights reserved.