Package org.nd4j.autodiff.samediff.ops
Class SDMath
- java.lang.Object
-
- org.nd4j.autodiff.samediff.ops.SDOps
-
- org.nd4j.autodiff.samediff.ops.SDMath
-
public class SDMath extends SDOps
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SDVariableabs(String name, SDVariable x)Elementwise absolute value operation: out = abs(x)SDVariableabs(SDVariable x)Elementwise absolute value operation: out = abs(x)SDVariableacos(String name, SDVariable x)Elementwise acos (arccosine, inverse cosine) operation: out = arccos(x)SDVariableacos(SDVariable x)Elementwise acos (arccosine, inverse cosine) operation: out = arccos(x)SDVariableacosh(String name, SDVariable x)Elementwise acosh (inverse hyperbolic cosine) function: out = acosh(x)SDVariableacosh(SDVariable x)Elementwise acosh (inverse hyperbolic cosine) function: out = acosh(x)SDVariableadd(String name, SDVariable x, double value)Scalar add operation, out = in + scalarSDVariableadd(String name, SDVariable x, SDVariable y)Pairwise addition operation, out = x + y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariableadd(SDVariable x, double value)Scalar add operation, out = in + scalarSDVariableadd(SDVariable x, SDVariable y)Pairwise addition operation, out = x + y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariableand(String name, SDVariable x, SDVariable 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.SDVariableand(SDVariable x, SDVariable 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.SDVariableasin(String name, SDVariable x)Elementwise asin (arcsin, inverse sine) operation: out = arcsin(x)SDVariableasin(SDVariable x)Elementwise asin (arcsin, inverse sine) operation: out = arcsin(x)SDVariableasinh(String name, SDVariable x)Elementwise asinh (inverse hyperbolic sine) function: out = asinh(x)SDVariableasinh(SDVariable x)Elementwise asinh (inverse hyperbolic sine) function: out = asinh(x)SDVariableasum(String name, SDVariable in, boolean keepDims, int... dimensions)Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))SDVariableasum(String name, SDVariable in, int... dimensions)Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))SDVariableasum(SDVariable in, boolean keepDims, int... dimensions)Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))SDVariableasum(SDVariable in, int... dimensions)Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))SDVariableatan(String name, SDVariable x)Elementwise atan (arctangent, inverse tangent) operation: out = arctangent(x)SDVariableatan(SDVariable x)Elementwise atan (arctangent, inverse tangent) operation: out = arctangent(x)SDVariableatan2(String name, SDVariable y, SDVariable 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 resultSDVariableatan2(SDVariable y, SDVariable 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 resultSDVariableatanh(String name, SDVariable x)Elementwise atanh (inverse hyperbolic tangent) function: out = atanh(x)SDVariableatanh(SDVariable x)Elementwise atanh (inverse hyperbolic tangent) function: out = atanh(x)SDVariablebitShift(String name, SDVariable x, SDVariable shift)Bit shift operationSDVariablebitShift(SDVariable x, SDVariable shift)Bit shift operationSDVariablebitShiftRight(String name, SDVariable x, SDVariable shift)Right bit shift operationSDVariablebitShiftRight(SDVariable x, SDVariable shift)Right bit shift operationSDVariablebitShiftRotl(String name, SDVariable x, SDVariable shift)Cyclic bit shift operationSDVariablebitShiftRotl(SDVariable x, SDVariable shift)Cyclic bit shift operationSDVariablebitShiftRotr(String name, SDVariable x, SDVariable shift)Cyclic right shift operationSDVariablebitShiftRotr(SDVariable x, SDVariable shift)Cyclic right shift operationSDVariableceil(String name, SDVariable x)Element-wise ceiling function: out = ceil(x).
Rounds each value up to the nearest integer value (if not already an integer)SDVariableceil(SDVariable x)Element-wise ceiling function: out = ceil(x).
Rounds each value up to the nearest integer value (if not already an integer)SDVariableclipByAvgNorm(String name, SDVariable x, double clipValue, int... dimensions)Clips tensor values to a maximum average L2-norm.SDVariableclipByAvgNorm(SDVariable x, double clipValue, int... dimensions)Clips tensor values to a maximum average L2-norm.SDVariableclipByNorm(String name, SDVariable 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 dimensionsSDVariableclipByNorm(SDVariable 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 dimensionsSDVariableclipByValue(String name, SDVariable 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] > clipValueMaxSDVariableclipByValue(SDVariable 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] > clipValueMaxSDVariableconfusionMatrix(String name, SDVariable labels, SDVariable 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]SDVariableconfusionMatrix(String name, SDVariable labels, SDVariable pred, SDVariable 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.SDVariableconfusionMatrix(String name, SDVariable labels, SDVariable pred, SDVariable 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]SDVariableconfusionMatrix(String name, SDVariable labels, SDVariable 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.SDVariableconfusionMatrix(SDVariable labels, SDVariable 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]SDVariableconfusionMatrix(SDVariable labels, SDVariable pred, SDVariable 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.SDVariableconfusionMatrix(SDVariable labels, SDVariable pred, SDVariable 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]SDVariableconfusionMatrix(SDVariable labels, SDVariable 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.SDVariablecos(String name, SDVariable x)Elementwise cosine operation: out = cos(x)SDVariablecos(SDVariable x)Elementwise cosine operation: out = cos(x)SDVariablecosh(String name, SDVariable x)Elementwise cosh (hyperbolic cosine) operation: out = cosh(x)SDVariablecosh(SDVariable x)Elementwise cosh (hyperbolic cosine) operation: out = cosh(x)SDVariablecosineDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Cosine distance reduction operation.SDVariablecosineDistance(String name, SDVariable x, SDVariable y, int... dimensions)Cosine distance reduction operation.SDVariablecosineDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Cosine distance reduction operation.SDVariablecosineDistance(SDVariable x, SDVariable y, int... dimensions)Cosine distance reduction operation.SDVariablecosineSimilarity(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Cosine similarity pairwise reduction operation.SDVariablecosineSimilarity(String name, SDVariable x, SDVariable y, int... dimensions)Cosine similarity pairwise reduction operation.SDVariablecosineSimilarity(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Cosine similarity pairwise reduction operation.SDVariablecosineSimilarity(SDVariable x, SDVariable y, int... dimensions)Cosine similarity pairwise reduction operation.SDVariablecountNonZero(String name, SDVariable in, boolean keepDims, int... dimensions)Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)SDVariablecountNonZero(String name, SDVariable in, int... dimensions)Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)SDVariablecountNonZero(SDVariable in, boolean keepDims, int... dimensions)Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)SDVariablecountNonZero(SDVariable in, int... dimensions)Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)SDVariablecountZero(String name, SDVariable in, boolean keepDims, int... dimensions)Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)SDVariablecountZero(String name, SDVariable in, int... dimensions)Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)SDVariablecountZero(SDVariable in, boolean keepDims, int... dimensions)Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)SDVariablecountZero(SDVariable in, int... dimensions)Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)SDVariablecross(String name, SDVariable a, SDVariable 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 3SDVariablecross(SDVariable a, SDVariable 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 3SDVariablecube(String name, SDVariable x)Element-wise cube function: out = x^3SDVariablecube(SDVariable x)Element-wise cube function: out = x^3SDVariablediag(String name, SDVariable 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 2RSDVariablediag(SDVariable 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 2RSDVariablediagPart(String name, SDVariable 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]SDVariablediagPart(SDVariable 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]SDVariablediv(String name, SDVariable x, double value)Scalar division operation, out = in / scalarSDVariablediv(String name, SDVariable x, SDVariable y)Pairwise division operation, out = x / y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablediv(SDVariable x, double value)Scalar division operation, out = in / scalarSDVariablediv(SDVariable x, SDVariable y)Pairwise division operation, out = x / y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariableembeddingLookup(String name, SDVariable x, SDVariable indices, PartitionMode PartitionMode)Looks up ids in a list of embedding tensors.SDVariableembeddingLookup(SDVariable x, SDVariable indices, PartitionMode PartitionMode)Looks up ids in a list of embedding tensors.SDVariableentropy(String name, SDVariable in, boolean keepDims, int... dimensions)Entropy reduction: -sum(x * log(x))SDVariableentropy(String name, SDVariable in, int... dimensions)Entropy reduction: -sum(x * log(x))SDVariableentropy(SDVariable in, boolean keepDims, int... dimensions)Entropy reduction: -sum(x * log(x))SDVariableentropy(SDVariable in, int... dimensions)Entropy reduction: -sum(x * log(x))SDVariableerf(String name, SDVariable x)Element-wise Gaussian error function - out = erf(in)SDVariableerf(SDVariable x)Element-wise Gaussian error function - out = erf(in)SDVariableerfc(String name, SDVariable x)Element-wise complementary Gaussian error function - out = erfc(in) = 1 - erf(in)SDVariableerfc(SDVariable x)Element-wise complementary Gaussian error function - out = erfc(in) = 1 - erf(in)SDVariableeuclideanDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Euclidean distance (l2 norm, l2 distance) reduction operation.SDVariableeuclideanDistance(String name, SDVariable x, SDVariable y, int... dimensions)Euclidean distance (l2 norm, l2 distance) reduction operation.SDVariableeuclideanDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Euclidean distance (l2 norm, l2 distance) reduction operation.SDVariableeuclideanDistance(SDVariable x, SDVariable y, int... dimensions)Euclidean distance (l2 norm, l2 distance) reduction operation.SDVariableexp(String name, SDVariable x)Elementwise exponent function: out = exp(x) = 2.71828...^xSDVariableexp(SDVariable x)Elementwise exponent function: out = exp(x) = 2.71828...^xSDVariableexpm1(String name, SDVariable x)Elementwise 1.0 - exponent function: out = 1.0 - exp(x) = 1.0 - 2.71828...^xSDVariableexpm1(SDVariable x)Elementwise 1.0 - exponent function: out = 1.0 - exp(x) = 1.0 - 2.71828...^xSDVariableeye(int rows)Generate an identity matrix with the specified number of rows and columns.SDVariableeye(int rows, int cols)As per eye(String, int, int, DataType) but with the default datatype, Eye.DEFAULT_DTYPESDVariableeye(int rows, int cols, DataType dataType, int... dimensions)Generate an identity matrix with the specified number of rows and columns
Example:SDVariableeye(String name, int rows)Generate an identity matrix with the specified number of rows and columns.SDVariableeye(String name, int rows, int cols)As per eye(String, int, int, DataType) but with the default datatype, Eye.DEFAULT_DTYPESDVariableeye(String name, int rows, int cols, DataType dataType, int... dimensions)Generate an identity matrix with the specified number of rows and columns
Example:SDVariableeye(String name, SDVariable rows)As per eye(String, int) but with the number of rows specified as a scalar INDArraySDVariableeye(String name, SDVariable rows, SDVariable cols)As per eye(int, int) bit with the number of rows/columns specified as scalar INDArraysSDVariableeye(SDVariable rows)As per eye(String, int) but with the number of rows specified as a scalar INDArraySDVariableeye(SDVariable rows, SDVariable cols)As per eye(int, int) bit with the number of rows/columns specified as scalar INDArraysSDVariablefirstIndex(String name, SDVariable 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.SDVariablefirstIndex(String name, SDVariable 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.SDVariablefirstIndex(SDVariable 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.SDVariablefirstIndex(SDVariable 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.SDVariablefloor(String name, SDVariable x)Element-wise floor function: out = floor(x).
Rounds each value down to the nearest integer value (if not already an integer)SDVariablefloor(SDVariable x)Element-wise floor function: out = floor(x).
Rounds each value down to the nearest integer value (if not already an integer)SDVariablefloorDiv(String name, SDVariable x, SDVariable y)Pairwise floor division operation, out = floor(x / y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablefloorDiv(SDVariable x, SDVariable y)Pairwise floor division operation, out = floor(x / y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablefloorMod(String name, SDVariable x, double value)Scalar floor modulus operationSDVariablefloorMod(String name, SDVariable x, SDVariable y)Pairwise Modulus division operation
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablefloorMod(SDVariable x, double value)Scalar floor modulus operationSDVariablefloorMod(SDVariable x, SDVariable y)Pairwise Modulus division operation
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablehammingDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Hamming distance reduction operation.SDVariablehammingDistance(String name, SDVariable x, SDVariable y, int... dimensions)Hamming distance reduction operation.SDVariablehammingDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Hamming distance reduction operation.SDVariablehammingDistance(SDVariable x, SDVariable y, int... dimensions)Hamming distance reduction operation.SDVariableiamax(String name, SDVariable in, boolean keepDims, int... dimensions)Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)SDVariableiamax(String name, SDVariable in, int... dimensions)Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)SDVariableiamax(SDVariable in, boolean keepDims, int... dimensions)Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)SDVariableiamax(SDVariable in, int... dimensions)Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)SDVariableiamin(String name, SDVariable in, boolean keepDims, int... dimensions)Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)SDVariableiamin(String name, SDVariable in, int... dimensions)Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)SDVariableiamin(SDVariable in, boolean keepDims, int... dimensions)Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)SDVariableiamin(SDVariable in, int... dimensions)Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)SDVariableisFinite(String name, SDVariable 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 otherwiseSDVariableisFinite(SDVariable 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 otherwiseSDVariableisInfinite(String name, SDVariable 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 otherwiseSDVariableisInfinite(SDVariable 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 otherwiseSDVariableisMax(String name, SDVariable 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 otherwiseSDVariableisMax(SDVariable 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 otherwiseSDVariableisNaN(String name, SDVariable 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 otherwiseSDVariableisNaN(SDVariable 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 otherwiseSDVariableisNonDecreasing(String name, SDVariable x)Is the array non decreasing?
An array is non-decreasing if for every valid i, x[i] <= x[i+1].SDVariableisNonDecreasing(SDVariable x)Is the array non decreasing?
An array is non-decreasing if for every valid i, x[i] <= x[i+1].SDVariableisStrictlyIncreasing(String name, SDVariable x)Is the array strictly increasing?
An array is strictly increasing if for every valid i, x[i] < x[i+1].SDVariableisStrictlyIncreasing(SDVariable x)Is the array strictly increasing?
An array is strictly increasing if for every valid i, x[i] < x[i+1].SDVariablejaccardDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Jaccard similarity reduction operation.SDVariablejaccardDistance(String name, SDVariable x, SDVariable y, int... dimensions)Jaccard similarity reduction operation.SDVariablejaccardDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Jaccard similarity reduction operation.SDVariablejaccardDistance(SDVariable x, SDVariable y, int... dimensions)Jaccard similarity reduction operation.SDVariablelastIndex(String name, SDVariable 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.SDVariablelastIndex(String name, SDVariable 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.SDVariablelastIndex(SDVariable 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.SDVariablelastIndex(SDVariable 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.SDVariable[]listDiff(String[] names, SDVariable x, SDVariable y)Calculates difference between inputs X and Y.SDVariable[]listDiff(SDVariable x, SDVariable y)Calculates difference between inputs X and Y.SDVariablelog(String name, SDVariable x)Element-wise logarithm function (base e - natural logarithm): out = log(x)SDVariablelog(String name, SDVariable x, double base)Element-wise logarithm function (with specified base): out = log_{base}(x)SDVariablelog(SDVariable x)Element-wise logarithm function (base e - natural logarithm): out = log(x)SDVariablelog(SDVariable x, double base)Element-wise logarithm function (with specified base): out = log_{base}(x)SDVariablelog1p(String name, SDVariable x)Elementwise natural logarithm function: out = log_e (1 + x)SDVariablelog1p(SDVariable x)Elementwise natural logarithm function: out = log_e (1 + x)SDVariablelogEntropy(String name, SDVariable in, boolean keepDims, int... dimensions)Log entropy reduction: log(-sum(x * log(x)))SDVariablelogEntropy(String name, SDVariable in, int... dimensions)Log entropy reduction: log(-sum(x * log(x)))SDVariablelogEntropy(SDVariable in, boolean keepDims, int... dimensions)Log entropy reduction: log(-sum(x * log(x)))SDVariablelogEntropy(SDVariable in, int... dimensions)Log entropy reduction: log(-sum(x * log(x)))SDVariablelogSumExp(String name, SDVariable input, int... dimensions)Log-sum-exp reduction (optionally along dimension).
Computes log(sum(exp(x))SDVariablelogSumExp(SDVariable input, int... dimensions)Log-sum-exp reduction (optionally along dimension).
Computes log(sum(exp(x))SDVariablemanhattanDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Manhattan distance (l1 norm, l1 distance) reduction operation.SDVariablemanhattanDistance(String name, SDVariable x, SDVariable y, int... dimensions)Manhattan distance (l1 norm, l1 distance) reduction operation.SDVariablemanhattanDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)Manhattan distance (l1 norm, l1 distance) reduction operation.SDVariablemanhattanDistance(SDVariable x, SDVariable y, int... dimensions)Manhattan distance (l1 norm, l1 distance) reduction operation.SDVariablematrixDeterminant(String name, SDVariable in)Matrix determinant op.SDVariablematrixDeterminant(SDVariable in)Matrix determinant op.SDVariablematrixInverse(String name, SDVariable in)Matrix inverse op.SDVariablematrixInverse(SDVariable in)Matrix inverse op.SDVariablemax(String name, SDVariable x, SDVariable y)Pairwise max operation, out = max(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablemax(SDVariable x, SDVariable y)Pairwise max operation, out = max(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablemean(String name, SDVariable in, boolean keepDims, int... dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablemean(String name, SDVariable in, int... dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablemean(String name, SDVariable in, SDVariable dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablemean(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablemean(SDVariable in, boolean keepDims, int... dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablemean(SDVariable in, int... dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablemean(SDVariable in, SDVariable dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablemean(SDVariable in, SDVariable dimensions, boolean keepDims)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablemergeAdd(String name, SDVariable... inputs)Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]SDVariablemergeAdd(SDVariable... inputs)Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]SDVariablemergeAvg(String name, SDVariable... inputs)Merge average function: merges an arbitrary number of equal shaped arrays using element-wise mean operation:
out = mean_i in[i]SDVariablemergeAvg(SDVariable... inputs)Merge average function: merges an arbitrary number of equal shaped arrays using element-wise mean operation:
out = mean_i in[i]SDVariablemergeMax(String name, SDVariable... inputs)Merge max function: merges an arbitrary number of equal shaped arrays using element-wise maximum operation:
out = max_i in[i]SDVariablemergeMax(SDVariable... inputs)Merge max function: merges an arbitrary number of equal shaped arrays using element-wise maximum operation:
out = max_i in[i]SDVariablemergeMaxIndex(String name, SDVariable... x)Return array of max elements indices with along tensor dimensionsSDVariablemergeMaxIndex(String name, SDVariable[] x, DataType dataType)Return array of max elements indices with along tensor dimensionsSDVariablemergeMaxIndex(SDVariable... x)Return array of max elements indices with along tensor dimensionsSDVariablemergeMaxIndex(SDVariable[] x, DataType dataType)Return array of max elements indices with along tensor dimensionsSDVariable[]meshgrid(String[] names, SDVariable[] inputs, boolean cartesian)Broadcasts parameters for evaluation on an N-D grid.SDVariable[]meshgrid(SDVariable[] inputs, boolean cartesian)Broadcasts parameters for evaluation on an N-D grid.SDVariablemin(String name, SDVariable x, SDVariable y)Pairwise max operation, out = min(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablemin(SDVariable x, SDVariable y)Pairwise max operation, out = min(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablemod(String name, SDVariable x, SDVariable y)Pairwise modulus (remainder) operation, out = x % y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablemod(SDVariable x, SDVariable y)Pairwise modulus (remainder) operation, out = x % y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariable[]moments(String[] names, SDVariable input, int[] axes, boolean keepDims)Calculate the mean and (population) variance for the input variable, for the specified axisSDVariable[]moments(String[] names, SDVariable input, SDVariable axes, boolean keepDims)Calculate the mean and (population) variance for the input variable, for the specified axisSDVariable[]moments(SDVariable input, int[] axes, boolean keepDims)Calculate the mean and (population) variance for the input variable, for the specified axisSDVariable[]moments(SDVariable input, SDVariable axes, boolean keepDims)Calculate the mean and (population) variance for the input variable, for the specified axisSDVariablemul(String name, SDVariable x, double value)Scalar multiplication operation, out = in * scalarSDVariablemul(String name, SDVariable x, SDVariable y)Pairwise multiplication operation, out = x * y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablemul(SDVariable x, double value)Scalar multiplication operation, out = in * scalarSDVariablemul(SDVariable x, SDVariable y)Pairwise multiplication operation, out = x * y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariableneg(String name, SDVariable x)Elementwise negative operation: out = -xSDVariableneg(SDVariable x)Elementwise negative operation: out = -xSDVariablenorm1(String name, SDVariable in, boolean keepDims, int... dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablenorm1(String name, SDVariable in, int... dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablenorm1(String name, SDVariable in, SDVariable dimensions)Sum of absolute differences.SDVariablenorm1(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Sum of absolute differences.SDVariablenorm1(SDVariable in, boolean keepDims, int... dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablenorm1(SDVariable in, int... dimensions)Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablenorm1(SDVariable in, SDVariable dimensions)Sum of absolute differences.SDVariablenorm1(SDVariable in, SDVariable dimensions, boolean keepDims)Sum of absolute differences.SDVariablenorm2(String name, SDVariable in, boolean keepDims, int... dimensions)Euclidean norm: euclidean distance of a vector from the originSDVariablenorm2(String name, SDVariable in, int... dimensions)Euclidean norm: euclidean distance of a vector from the originSDVariablenorm2(String name, SDVariable in, SDVariable dimensions)Euclidean norm: euclidean distance of a vector from the originSDVariablenorm2(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Euclidean norm: euclidean distance of a vector from the originSDVariablenorm2(SDVariable in, boolean keepDims, int... dimensions)Euclidean norm: euclidean distance of a vector from the originSDVariablenorm2(SDVariable in, int... dimensions)Euclidean norm: euclidean distance of a vector from the originSDVariablenorm2(SDVariable in, SDVariable dimensions)Euclidean norm: euclidean distance of a vector from the originSDVariablenorm2(SDVariable in, SDVariable dimensions, boolean keepDims)Euclidean norm: euclidean distance of a vector from the originSDVariable[]normalizeMoments(String[] names, SDVariable counts, SDVariable means, SDVariable variances, double shift)Calculate the mean and variance from the sufficient statisticsSDVariable[]normalizeMoments(SDVariable counts, SDVariable means, SDVariable variances, double shift)Calculate the mean and variance from the sufficient statisticsSDVariablenormMax(String name, SDVariable in, boolean keepDims, int... dimensions)Differences between max absolute valueSDVariablenormMax(String name, SDVariable in, int... dimensions)Differences between max absolute valueSDVariablenormMax(String name, SDVariable in, SDVariable dimensions)Differences between max absolute valueSDVariablenormMax(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Differences between max absolute valueSDVariablenormMax(SDVariable in, boolean keepDims, int... dimensions)Differences between max absolute valueSDVariablenormMax(SDVariable in, int... dimensions)Differences between max absolute valueSDVariablenormMax(SDVariable in, SDVariable dimensions)Differences between max absolute valueSDVariablenormMax(SDVariable in, SDVariable dimensions, boolean keepDims)Differences between max absolute valueSDVariableor(String name, SDVariable x, SDVariable 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.SDVariableor(SDVariable x, SDVariable 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.SDVariablepow(String name, SDVariable x, double value)Element-wise power function: out = x^valueSDVariablepow(String name, SDVariable x, SDVariable y)Element-wise (broadcastable) power function: out = x[i]^y[i]SDVariablepow(SDVariable x, double value)Element-wise power function: out = x^valueSDVariablepow(SDVariable x, SDVariable y)Element-wise (broadcastable) power function: out = x[i]^y[i]SDVariableprod(String name, SDVariable in, boolean keepDims, int... dimensions)The max of an array along each dimensionSDVariableprod(String name, SDVariable in, int... dimensions)The max of an array along each dimensionSDVariableprod(String name, SDVariable in, SDVariable dimensions)The product of an array long each dimensionSDVariableprod(String name, SDVariable in, SDVariable dimensions, boolean keepDims)The product of an array long each dimensionSDVariableprod(SDVariable in, boolean keepDims, int... dimensions)The max of an array along each dimensionSDVariableprod(SDVariable in, int... dimensions)The max of an array along each dimensionSDVariableprod(SDVariable in, SDVariable dimensions)The product of an array long each dimensionSDVariableprod(SDVariable in, SDVariable dimensions, boolean keepDims)The product of an array long each dimensionSDVariablerationalTanh(String name, SDVariable x)Rational Tanh Approximation elementwise function, as described in the paper:
Compact Convolutional Neural Network Cascade for Face Detection
This is a faster Tanh approximationSDVariablerationalTanh(SDVariable x)Rational Tanh Approximation elementwise function, as described in the paper:
Compact Convolutional Neural Network Cascade for Face Detection
This is a faster Tanh approximationSDVariablerdiv(String name, SDVariable x, double value)Scalar reverse division operation, out = scalar / inSDVariablerdiv(String name, SDVariable x, SDVariable y)Pairwise reverse division operation, out = y / x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablerdiv(SDVariable x, double value)Scalar reverse division operation, out = scalar / inSDVariablerdiv(SDVariable x, SDVariable y)Pairwise reverse division operation, out = y / x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablereciprocal(String name, SDVariable x)Element-wise reciprocal (inverse) function: out[i] = 1 / in[i]SDVariablereciprocal(SDVariable x)Element-wise reciprocal (inverse) function: out[i] = 1 / in[i]SDVariablerectifiedTanh(String name, SDVariable x)Rectified tanh operation: max(0, tanh(in))SDVariablerectifiedTanh(SDVariable x)Rectified tanh operation: max(0, tanh(in))SDVariablereduceAMax(String name, SDVariable in, boolean keepDims, int... dimensions)Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))SDVariablereduceAMax(String name, SDVariable in, int... dimensions)Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))SDVariablereduceAMax(String name, SDVariable in, SDVariable dimensions)Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))SDVariablereduceAMax(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))SDVariablereduceAMax(SDVariable in, boolean keepDims, int... dimensions)Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))SDVariablereduceAMax(SDVariable in, int... dimensions)Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))SDVariablereduceAMax(SDVariable in, SDVariable dimensions)Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))SDVariablereduceAMax(SDVariable in, SDVariable dimensions, boolean keepDims)Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))SDVariablereduceAmean(String name, SDVariable in, boolean keepDims, int... dimensions)Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablereduceAmean(String name, SDVariable in, int... dimensions)Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablereduceAmean(String name, SDVariable in, SDVariable dimensions)Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablereduceAmean(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablereduceAmean(SDVariable in, boolean keepDims, int... dimensions)Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablereduceAmean(SDVariable in, int... dimensions)Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablereduceAmean(SDVariable in, SDVariable dimensions)Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablereduceAmean(SDVariable in, SDVariable dimensions, boolean keepDims)Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))SDVariablereduceAmin(String name, SDVariable in, boolean keepDims, int... dimensions)Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))SDVariablereduceAmin(String name, SDVariable in, int... dimensions)Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))SDVariablereduceAmin(String name, SDVariable in, SDVariable dimensions)Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))SDVariablereduceAmin(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))SDVariablereduceAmin(SDVariable in, boolean keepDims, int... dimensions)Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))SDVariablereduceAmin(SDVariable in, int... dimensions)Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))SDVariablereduceAmin(SDVariable in, SDVariable dimensions)Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))SDVariablereduceAmin(SDVariable in, SDVariable dimensions, boolean keepDims)Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))SDVariablereduceMax(String name, SDVariable in, boolean keepDims, int... dimensions)The max of an array along each dimensionSDVariablereduceMax(String name, SDVariable in, int... dimensions)The max of an array along each dimensionSDVariablereduceMax(String name, SDVariable in, SDVariable dimensions)The max of an array long each dimensionSDVariablereduceMax(String name, SDVariable in, SDVariable dimensions, boolean keepDims)The max of an array long each dimensionSDVariablereduceMax(SDVariable in, boolean keepDims, int... dimensions)The max of an array along each dimensionSDVariablereduceMax(SDVariable in, int... dimensions)The max of an array along each dimensionSDVariablereduceMax(SDVariable in, SDVariable dimensions)The max of an array long each dimensionSDVariablereduceMax(SDVariable in, SDVariable dimensions, boolean keepDims)The max of an array long each dimensionSDVariablereduceMin(String name, SDVariable in, boolean keepDims, int... dimensions)The minimum of an array along each dimensionSDVariablereduceMin(String name, SDVariable in, int... dimensions)The minimum of an array along each dimensionSDVariablereduceMin(String name, SDVariable in, SDVariable dimensions)The minimum of an array long each dimensionSDVariablereduceMin(String name, SDVariable in, SDVariable dimensions, boolean keepDims)The minimum of an array long each dimensionSDVariablereduceMin(SDVariable in, boolean keepDims, int... dimensions)The minimum of an array along each dimensionSDVariablereduceMin(SDVariable in, int... dimensions)The minimum of an array along each dimensionSDVariablereduceMin(SDVariable in, SDVariable dimensions)The minimum of an array long each dimensionSDVariablereduceMin(SDVariable in, SDVariable dimensions, boolean keepDims)The minimum of an array long each dimensionSDVariableround(String name, SDVariable x)Element-wise round function: out = round(x).
Rounds (up or down depending on value) to the nearest integer value.SDVariableround(SDVariable x)Element-wise round function: out = round(x).
Rounds (up or down depending on value) to the nearest integer value.SDVariablersqrt(String name, SDVariable x)Element-wise reciprocal (inverse) of square root: out = 1.0 / sqrt(x)SDVariablersqrt(SDVariable x)Element-wise reciprocal (inverse) of square root: out = 1.0 / sqrt(x)SDVariablersub(String name, SDVariable x, double value)Scalar reverse subtraction operation, out = scalar - inSDVariablersub(String name, SDVariable x, SDVariable y)Pairwise reverse subtraction operation, out = y - x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablersub(SDVariable x, double value)Scalar reverse subtraction operation, out = scalar - inSDVariablersub(SDVariable x, SDVariable y)Pairwise reverse subtraction operation, out = y - x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablesetDiag(String name, SDVariable in, SDVariable 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]SDVariablesetDiag(SDVariable in, SDVariable 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]SDVariableshannonEntropy(String name, SDVariable in, boolean keepDims, int... dimensions)Shannon Entropy reduction: -sum(x * log2(x))SDVariableshannonEntropy(String name, SDVariable in, int... dimensions)Shannon Entropy reduction: -sum(x * log2(x))SDVariableshannonEntropy(String name, SDVariable in, SDVariable dimensions)Shannon Entropy reduction: -sum(x * log2(x))SDVariableshannonEntropy(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Shannon Entropy reduction: -sum(x * log2(x))SDVariableshannonEntropy(SDVariable in, boolean keepDims, int... dimensions)Shannon Entropy reduction: -sum(x * log2(x))SDVariableshannonEntropy(SDVariable in, int... dimensions)Shannon Entropy reduction: -sum(x * log2(x))SDVariableshannonEntropy(SDVariable in, SDVariable dimensions)Shannon Entropy reduction: -sum(x * log2(x))SDVariableshannonEntropy(SDVariable in, SDVariable dimensions, boolean keepDims)Shannon Entropy reduction: -sum(x * log2(x))SDVariablesign(String name, SDVariable x)Element-wise sign (signum) function:
out = -1 if in < 0
out = 0 if in = 0
out = 1 if in > 0SDVariablesign(SDVariable x)Element-wise sign (signum) function:
out = -1 if in < 0
out = 0 if in = 0
out = 1 if in > 0SDVariablesin(String name, SDVariable x)Elementwise sine operation: out = sin(x)SDVariablesin(SDVariable x)Elementwise sine operation: out = sin(x)SDVariablesinh(String name, SDVariable x)Elementwise sinh (hyperbolic sine) operation: out = sinh(x)SDVariablesinh(SDVariable x)Elementwise sinh (hyperbolic sine) operation: out = sinh(x)SDVariablesqrt(String name, SDVariable x)Element-wise square root function: out = sqrt(x)SDVariablesqrt(SDVariable x)Element-wise square root function: out = sqrt(x)SDVariablesquare(String name, SDVariable x)Element-wise square function: out = x^2SDVariablesquare(SDVariable x)Element-wise square function: out = x^2SDVariablesquaredDifference(String name, SDVariable x, SDVariable y)Pairwise squared difference operation.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablesquaredDifference(SDVariable x, SDVariable y)Pairwise squared difference operation.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablesquaredNorm(String name, SDVariable in, boolean keepDims, int... dimensions)Sum of squared differences.SDVariablesquaredNorm(String name, SDVariable in, int... dimensions)Sum of squared differences.SDVariablesquaredNorm(String name, SDVariable in, SDVariable dimensions)Sum of squared differences.SDVariablesquaredNorm(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Sum of squared differences.SDVariablesquaredNorm(SDVariable in, boolean keepDims, int... dimensions)Sum of squared differences.SDVariablesquaredNorm(SDVariable in, int... dimensions)Sum of squared differences.SDVariablesquaredNorm(SDVariable in, SDVariable dimensions)Sum of squared differences.SDVariablesquaredNorm(SDVariable in, SDVariable dimensions, boolean keepDims)Sum of squared differences.SDVariablestandardize(String name, SDVariable x, int... dimensions)Standardize input variable along given axisSDVariablestandardize(SDVariable x, int... dimensions)Standardize input variable along given axisSDVariablestep(String name, SDVariable x, double value)Elementwise step function:
out(x) = 1 if x >= cutoff
out(x) = 0 otherwiseSDVariablestep(SDVariable x, double value)Elementwise step function:
out(x) = 1 if x >= cutoff
out(x) = 0 otherwiseSDVariablesub(String name, SDVariable x, double value)Scalar subtraction operation, out = in - scalarSDVariablesub(String name, SDVariable x, SDVariable y)Pairwise subtraction operation, out = x - y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablesub(SDVariable x, double value)Scalar subtraction operation, out = in - scalarSDVariablesub(SDVariable x, SDVariable y)Pairwise subtraction operation, out = x - y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.htmlSDVariablesum(String name, SDVariable in, boolean keepDims, int... dimensions)Sum of an array, optionally along specified dimensions: out = sum(x))SDVariablesum(String name, SDVariable in, int... dimensions)Sum of an array, optionally along specified dimensions: out = sum(x))SDVariablesum(String name, SDVariable in, SDVariable dimensions)Sum of an array, optionally along specified dimensions: out = sum(x))SDVariablesum(String name, SDVariable in, SDVariable dimensions, boolean keepDims)Sum of an array, optionally along specified dimensions: out = sum(x))SDVariablesum(SDVariable in, boolean keepDims, int... dimensions)Sum of an array, optionally along specified dimensions: out = sum(x))SDVariablesum(SDVariable in, int... dimensions)Sum of an array, optionally along specified dimensions: out = sum(x))SDVariablesum(SDVariable in, SDVariable dimensions)Sum of an array, optionally along specified dimensions: out = sum(x))SDVariablesum(SDVariable in, SDVariable dimensions, boolean keepDims)Sum of an array, optionally along specified dimensions: out = sum(x))SDVariabletan(String name, SDVariable x)Elementwise tangent operation: out = tan(x)SDVariabletan(SDVariable x)Elementwise tangent operation: out = tan(x)SDVariabletanh(String name, SDVariable x)Elementwise tanh (hyperbolic tangent) operation: out = tanh(x)SDVariabletanh(SDVariable x)Elementwise tanh (hyperbolic tangent) operation: out = tanh(x)SDVariabletrace(String name, SDVariable in)Matrix trace operation
For rank 2 matrices, the output is a scalar with the trace - i.e., sum of the main diagonal.
For higher rank inputs, output[a,b,c] = trace(in[a,b,c,:,:])SDVariabletrace(SDVariable in)Matrix trace operation
For rank 2 matrices, the output is a scalar with the trace - i.e., sum of the main diagonal.
For higher rank inputs, output[a,b,c] = trace(in[a,b,c,:,:])SDVariablexor(String name, SDVariable x, SDVariable 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.SDVariablexor(SDVariable x, SDVariable 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.SDVariablezeroFraction(String name, SDVariable input)Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))SDVariablezeroFraction(SDVariable input)Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))
-
-
-
Constructor Detail
-
SDMath
public SDMath(SameDiff sameDiff)
-
-
Method Detail
-
clipByAvgNorm
public SDVariable clipByAvgNorm(SDVariable x, double clipValue, int... dimensions)
Clips tensor values to a maximum average L2-norm.- Parameters:
x- Input variable (NUMERIC type)clipValue- Value for clippingdimensions- Dimensions to reduce over (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
clipByAvgNorm
public SDVariable clipByAvgNorm(String name, SDVariable x, double clipValue, int... dimensions)
Clips tensor values to a maximum average L2-norm.- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)clipValue- Value for clippingdimensions- Dimensions to reduce over (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
embeddingLookup
public SDVariable embeddingLookup(SDVariable x, SDVariable indices, PartitionMode PartitionMode)
Looks up ids in a list of embedding tensors.- Parameters:
x- Input tensor (NUMERIC type)indices- A Tensor containing the ids to be looked up. (INT type)PartitionMode- partition_mode == 0 - i.e. 'mod' , 1 - 'div'- Returns:
- output Shifted output (NUMERIC type)
-
embeddingLookup
public SDVariable embeddingLookup(String name, SDVariable x, SDVariable indices, PartitionMode PartitionMode)
Looks up ids in a list of embedding tensors.- Parameters:
name- name May be null. Name for the output variablex- Input tensor (NUMERIC type)indices- A Tensor containing the ids to be looked up. (INT type)PartitionMode- partition_mode == 0 - i.e. 'mod' , 1 - 'div'- Returns:
- output Shifted output (NUMERIC type)
-
mergeMaxIndex
public SDVariable mergeMaxIndex(SDVariable[] x, DataType dataType)
Return array of max elements indices with along tensor dimensions- Parameters:
x- Input tensor (NUMERIC type)dataType- Data type- Returns:
- output Array max elements indices with along dimensions. (INT type)
-
mergeMaxIndex
public SDVariable mergeMaxIndex(String name, SDVariable[] x, DataType dataType)
Return array of max elements indices with along tensor dimensions- Parameters:
name- name May be null. Name for the output variablex- Input tensor (NUMERIC type)dataType- Data type- Returns:
- output Array max elements indices with along dimensions. (INT type)
-
mergeMaxIndex
public SDVariable mergeMaxIndex(SDVariable... x)
Return array of max elements indices with along tensor dimensions- Parameters:
x- Input tensor (NUMERIC type)- Returns:
- output Array max elements indices with along dimensions. (INT type)
-
mergeMaxIndex
public SDVariable mergeMaxIndex(String name, SDVariable... x)
Return array of max elements indices with along tensor dimensions- Parameters:
name- name May be null. Name for the output variablex- Input tensor (NUMERIC type)- Returns:
- output Array max elements indices with along dimensions. (INT type)
-
abs
public SDVariable abs(SDVariable x)
Elementwise absolute value operation: out = abs(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
abs
public SDVariable abs(String name, SDVariable x)
Elementwise absolute value operation: out = abs(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
acos
public SDVariable acos(SDVariable x)
Elementwise acos (arccosine, inverse cosine) operation: out = arccos(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
acos
public SDVariable acos(String name, SDVariable x)
Elementwise acos (arccosine, inverse cosine) operation: out = arccos(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
acosh
public SDVariable acosh(SDVariable x)
Elementwise acosh (inverse hyperbolic cosine) function: out = acosh(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
acosh
public SDVariable acosh(String name, SDVariable x)
Elementwise acosh (inverse hyperbolic cosine) function: out = acosh(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
add
public SDVariable add(SDVariable x, SDVariable y)
Pairwise addition operation, out = x + y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
add
public SDVariable add(String name, SDVariable x, SDVariable y)
Pairwise addition operation, out = x + y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
add
public SDVariable add(SDVariable x, double value)
Scalar add operation, out = in + scalar- Parameters:
x- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
add
public SDVariable add(String name, SDVariable x, double value)
Scalar add operation, out = in + scalar- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
and
public SDVariable and(SDVariable x, SDVariable 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.- Parameters:
x- Input 1 (BOOL type)y- Input 2 (BOOL type)- Returns:
- output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
-
and
public SDVariable and(String name, SDVariable x, SDVariable 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.- Parameters:
name- name May be null. Name for the output variablex- Input 1 (BOOL type)y- Input 2 (BOOL type)- Returns:
- output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
-
asin
public SDVariable asin(SDVariable x)
Elementwise asin (arcsin, inverse sine) operation: out = arcsin(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
asin
public SDVariable asin(String name, SDVariable x)
Elementwise asin (arcsin, inverse sine) operation: out = arcsin(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
asinh
public SDVariable asinh(SDVariable x)
Elementwise asinh (inverse hyperbolic sine) function: out = asinh(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
asinh
public SDVariable asinh(String name, SDVariable x)
Elementwise asinh (inverse hyperbolic sine) function: out = asinh(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
asum
public SDVariable asum(SDVariable in, boolean keepDims, int... dimensions)
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
asum
public SDVariable asum(String name, SDVariable in, boolean keepDims, int... dimensions)
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
asum
public SDVariable asum(SDVariable in, int... dimensions)
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
asum
public SDVariable asum(String name, SDVariable in, int... dimensions)
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
atan
public SDVariable atan(SDVariable x)
Elementwise atan (arctangent, inverse tangent) operation: out = arctangent(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
atan
public SDVariable atan(String name, SDVariable x)
Elementwise atan (arctangent, inverse tangent) operation: out = arctangent(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
atan2
public SDVariable atan2(SDVariable y, SDVariable 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- Parameters:
y- Input Y variable (NUMERIC type)x- Input X variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
atan2
public SDVariable atan2(String name, SDVariable y, SDVariable 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- Parameters:
name- name May be null. Name for the output variabley- Input Y variable (NUMERIC type)x- Input X variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
atanh
public SDVariable atanh(SDVariable x)
Elementwise atanh (inverse hyperbolic tangent) function: out = atanh(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
atanh
public SDVariable atanh(String name, SDVariable x)
Elementwise atanh (inverse hyperbolic tangent) function: out = atanh(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
bitShift
public SDVariable bitShift(SDVariable x, SDVariable shift)
Bit shift operation- Parameters:
x- input (NUMERIC type)shift- shift value (NUMERIC type)- Returns:
- output shifted output (NUMERIC type)
-
bitShift
public SDVariable bitShift(String name, SDVariable x, SDVariable shift)
Bit shift operation- Parameters:
name- name May be null. Name for the output variablex- input (NUMERIC type)shift- shift value (NUMERIC type)- Returns:
- output shifted output (NUMERIC type)
-
bitShiftRight
public SDVariable bitShiftRight(SDVariable x, SDVariable shift)
Right bit shift operation- Parameters:
x- Input tensor (NUMERIC type)shift- shift argument (NUMERIC type)- Returns:
- output shifted output (NUMERIC type)
-
bitShiftRight
public SDVariable bitShiftRight(String name, SDVariable x, SDVariable shift)
Right bit shift operation- Parameters:
name- name May be null. Name for the output variablex- Input tensor (NUMERIC type)shift- shift argument (NUMERIC type)- Returns:
- output shifted output (NUMERIC type)
-
bitShiftRotl
public SDVariable bitShiftRotl(SDVariable x, SDVariable shift)
Cyclic bit shift operation- Parameters:
x- Input tensor (NUMERIC type)shift- shift argy=ument (NUMERIC type)- Returns:
- output shifted output (NUMERIC type)
-
bitShiftRotl
public SDVariable bitShiftRotl(String name, SDVariable x, SDVariable shift)
Cyclic bit shift operation- Parameters:
name- name May be null. Name for the output variablex- Input tensor (NUMERIC type)shift- shift argy=ument (NUMERIC type)- Returns:
- output shifted output (NUMERIC type)
-
bitShiftRotr
public SDVariable bitShiftRotr(SDVariable x, SDVariable shift)
Cyclic right shift operation- Parameters:
x- Input tensor (NUMERIC type)shift- Shift argument (NUMERIC type)- Returns:
- output Shifted output (NUMERIC type)
-
bitShiftRotr
public SDVariable bitShiftRotr(String name, SDVariable x, SDVariable shift)
Cyclic right shift operation- Parameters:
name- name May be null. Name for the output variablex- Input tensor (NUMERIC type)shift- Shift argument (NUMERIC type)- Returns:
- output Shifted output (NUMERIC type)
-
ceil
public SDVariable ceil(SDVariable x)
Element-wise ceiling function: out = ceil(x).
Rounds each value up to the nearest integer value (if not already an integer)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
ceil
public SDVariable ceil(String name, SDVariable x)
Element-wise ceiling function: out = ceil(x).
Rounds each value up to the nearest integer value (if not already an integer)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
clipByNorm
public SDVariable clipByNorm(SDVariable 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- Parameters:
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))- Returns:
- output Output variable (NUMERIC type)
-
clipByNorm
public SDVariable clipByNorm(String name, SDVariable 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- Parameters:
name- name May be null. Name for the output variablex- 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))- Returns:
- output Output variable (NUMERIC type)
-
clipByValue
public SDVariable clipByValue(SDVariable 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- Parameters:
x- Input variable (NUMERIC type)clipValueMin- Minimum value for clippingclipValueMax- Maximum value for clipping- Returns:
- output Output variable (NUMERIC type)
-
clipByValue
public SDVariable clipByValue(String name, SDVariable 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- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)clipValueMin- Minimum value for clippingclipValueMax- Maximum value for clipping- Returns:
- output Output variable (NUMERIC type)
-
confusionMatrix
public SDVariable confusionMatrix(SDVariable labels, SDVariable 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. This version assumes the number of classes is 1 + max(max(labels), max(pred))
For example, if labels = [0, 1, 1] and predicted = [0, 2, 1] then output is:
[1, 0, 0]
[0, 1, 1]
[0, 0, 0]- Parameters:
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 type- Returns:
- output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
-
confusionMatrix
public SDVariable confusionMatrix(String name, SDVariable labels, SDVariable 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. This version assumes the number of classes is 1 + max(max(labels), max(pred))
For example, if labels = [0, 1, 1] and predicted = [0, 2, 1] then output is:
[1, 0, 0]
[0, 1, 1]
[0, 0, 0]- Parameters:
name- name May be null. Name for the output variablelabels- 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 type- Returns:
- output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
-
confusionMatrix
public SDVariable confusionMatrix(SDVariable labels, SDVariable 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]- Parameters:
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 classes- Returns:
- output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
-
confusionMatrix
public SDVariable confusionMatrix(String name, SDVariable labels, SDVariable 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]- Parameters:
name- name May be null. Name for the output variablelabels- 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 classes- Returns:
- output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
-
confusionMatrix
public SDVariable confusionMatrix(SDVariable labels, SDVariable pred, SDVariable 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. This version assumes the number of classes is 1 + max(max(labels), max(pred))
For example, if labels = [0, 1, 1], predicted = [0, 2, 1] and weights = [1, 2, 3]
[1, 0, 0]
[0, 3, 2]
[0, 0, 0]- Parameters:
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)- Returns:
- output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
-
confusionMatrix
public SDVariable confusionMatrix(String name, SDVariable labels, SDVariable pred, SDVariable 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. This version assumes the number of classes is 1 + max(max(labels), max(pred))
For example, if labels = [0, 1, 1], predicted = [0, 2, 1] and weights = [1, 2, 3]
[1, 0, 0]
[0, 3, 2]
[0, 0, 0]- Parameters:
name- name May be null. Name for the output variablelabels- 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)- Returns:
- output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
-
confusionMatrix
public SDVariable confusionMatrix(SDVariable labels, SDVariable pred, SDVariable 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]- Parameters:
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-- Returns:
- output Output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
-
confusionMatrix
public SDVariable confusionMatrix(String name, SDVariable labels, SDVariable pred, SDVariable 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]- Parameters:
name- name May be null. Name for the output variablelabels- 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-- Returns:
- output Output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
-
cos
public SDVariable cos(SDVariable x)
Elementwise cosine operation: out = cos(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
cos
public SDVariable cos(String name, SDVariable x)
Elementwise cosine operation: out = cos(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
cosh
public SDVariable cosh(SDVariable x)
Elementwise cosh (hyperbolic cosine) operation: out = cosh(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
cosh
public SDVariable cosh(String name, SDVariable x)
Elementwise cosh (hyperbolic cosine) operation: out = cosh(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
cosineDistance
public SDVariable cosineDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Cosine distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = 1.0 - cosineSimilarity(x,y)- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
cosineDistance
public SDVariable cosineDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Cosine distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = 1.0 - cosineSimilarity(x,y)- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
cosineDistance
public SDVariable cosineDistance(SDVariable x, SDVariable y, int... dimensions)
Cosine distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = 1.0 - cosineSimilarity(x,y)- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
cosineDistance
public SDVariable cosineDistance(String name, SDVariable x, SDVariable y, int... dimensions)
Cosine distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = 1.0 - cosineSimilarity(x,y)- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
cosineSimilarity
public SDVariable cosineSimilarity(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Cosine similarity pairwise reduction operation. The output contains the cosine similarity for each tensor/subset
along the specified dimensions:
out = (sum_i x[i] * y[i]) / ( sqrt(sum_i x[i]^2) * sqrt(sum_i y[i]^2)- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
cosineSimilarity
public SDVariable cosineSimilarity(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Cosine similarity pairwise reduction operation. The output contains the cosine similarity for each tensor/subset
along the specified dimensions:
out = (sum_i x[i] * y[i]) / ( sqrt(sum_i x[i]^2) * sqrt(sum_i y[i]^2)- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
cosineSimilarity
public SDVariable cosineSimilarity(SDVariable x, SDVariable y, int... dimensions)
Cosine similarity pairwise reduction operation. The output contains the cosine similarity for each tensor/subset
along the specified dimensions:
out = (sum_i x[i] * y[i]) / ( sqrt(sum_i x[i]^2) * sqrt(sum_i y[i]^2)- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
cosineSimilarity
public SDVariable cosineSimilarity(String name, SDVariable x, SDVariable y, int... dimensions)
Cosine similarity pairwise reduction operation. The output contains the cosine similarity for each tensor/subset
along the specified dimensions:
out = (sum_i x[i] * y[i]) / ( sqrt(sum_i x[i]^2) * sqrt(sum_i y[i]^2)- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
countNonZero
public SDVariable countNonZero(SDVariable in, boolean keepDims, int... dimensions)
Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
countNonZero
public SDVariable countNonZero(String name, SDVariable in, boolean keepDims, int... dimensions)
Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
countNonZero
public SDVariable countNonZero(SDVariable in, int... dimensions)
Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
countNonZero
public SDVariable countNonZero(String name, SDVariable in, int... dimensions)
Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
countZero
public SDVariable countZero(SDVariable in, boolean keepDims, int... dimensions)
Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
countZero
public SDVariable countZero(String name, SDVariable in, boolean keepDims, int... dimensions)
Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
countZero
public SDVariable countZero(SDVariable in, int... dimensions)
Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
countZero
public SDVariable countZero(String name, SDVariable in, int... dimensions)
Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
cross
public SDVariable cross(SDVariable a, SDVariable 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- Parameters:
a- First input (NUMERIC type)b- Second input (NUMERIC type)- Returns:
- output Element-wise cross product (NUMERIC type)
-
cross
public SDVariable cross(String name, SDVariable a, SDVariable 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- Parameters:
name- name May be null. Name for the output variablea- First input (NUMERIC type)b- Second input (NUMERIC type)- Returns:
- output Element-wise cross product (NUMERIC type)
-
cube
public SDVariable cube(SDVariable x)
Element-wise cube function: out = x^3- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
cube
public SDVariable cube(String name, SDVariable x)
Element-wise cube function: out = x^3- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
diag
public SDVariable diag(SDVariable 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- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
diag
public SDVariable diag(String name, SDVariable 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- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
diagPart
public SDVariable diagPart(SDVariable 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]- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Diagonal part of the input (NUMERIC type)
-
diagPart
public SDVariable diagPart(String name, SDVariable 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]- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Diagonal part of the input (NUMERIC type)
-
div
public SDVariable div(SDVariable x, SDVariable y)
Pairwise division operation, out = x / y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
div
public SDVariable div(String name, SDVariable x, SDVariable y)
Pairwise division operation, out = x / y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
div
public SDVariable div(SDVariable x, double value)
Scalar division operation, out = in / scalar- Parameters:
x- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
div
public SDVariable div(String name, SDVariable x, double value)
Scalar division operation, out = in / scalar- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
entropy
public SDVariable entropy(SDVariable in, boolean keepDims, int... dimensions)
Entropy reduction: -sum(x * log(x))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
entropy
public SDVariable entropy(String name, SDVariable in, boolean keepDims, int... dimensions)
Entropy reduction: -sum(x * log(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
entropy
public SDVariable entropy(SDVariable in, int... dimensions)
Entropy reduction: -sum(x * log(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
entropy
public SDVariable entropy(String name, SDVariable in, int... dimensions)
Entropy reduction: -sum(x * log(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
erf
public SDVariable erf(SDVariable x)
Element-wise Gaussian error function - out = erf(in)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
erf
public SDVariable erf(String name, SDVariable x)
Element-wise Gaussian error function - out = erf(in)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
erfc
public SDVariable erfc(SDVariable x)
Element-wise complementary Gaussian error function - out = erfc(in) = 1 - erf(in)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
erfc
public SDVariable erfc(String name, SDVariable x)
Element-wise complementary Gaussian error function - out = erfc(in) = 1 - erf(in)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
euclideanDistance
public SDVariable euclideanDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Euclidean distance (l2 norm, l2 distance) reduction operation. The output contains the Euclidean distance for each
tensor/subset along the specified dimensions:
out = sqrt( sum_i (x[i] - y[i])^2 )- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
euclideanDistance
public SDVariable euclideanDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Euclidean distance (l2 norm, l2 distance) reduction operation. The output contains the Euclidean distance for each
tensor/subset along the specified dimensions:
out = sqrt( sum_i (x[i] - y[i])^2 )- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
euclideanDistance
public SDVariable euclideanDistance(SDVariable x, SDVariable y, int... dimensions)
Euclidean distance (l2 norm, l2 distance) reduction operation. The output contains the Euclidean distance for each
tensor/subset along the specified dimensions:
out = sqrt( sum_i (x[i] - y[i])^2 )- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
euclideanDistance
public SDVariable euclideanDistance(String name, SDVariable x, SDVariable y, int... dimensions)
Euclidean distance (l2 norm, l2 distance) reduction operation. The output contains the Euclidean distance for each
tensor/subset along the specified dimensions:
out = sqrt( sum_i (x[i] - y[i])^2 )- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
exp
public SDVariable exp(SDVariable x)
Elementwise exponent function: out = exp(x) = 2.71828...^x- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
exp
public SDVariable exp(String name, SDVariable x)
Elementwise exponent function: out = exp(x) = 2.71828...^x- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
expm1
public SDVariable expm1(SDVariable x)
Elementwise 1.0 - exponent function: out = 1.0 - exp(x) = 1.0 - 2.71828...^x- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
expm1
public SDVariable expm1(String name, SDVariable x)
Elementwise 1.0 - exponent function: out = 1.0 - exp(x) = 1.0 - 2.71828...^x- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
eye
public SDVariable eye(int rows)
Generate an identity matrix with the specified number of rows and columns.- Parameters:
rows- Number of rows- Returns:
- output Identity matrix (NUMERIC type)
-
eye
public SDVariable eye(String name, int rows)
Generate an identity matrix with the specified number of rows and columns.- Parameters:
name- name May be null. Name for the output variablerows- Number of rows- Returns:
- output Identity matrix (NUMERIC type)
-
eye
public SDVariable eye(int rows, int cols)
As per eye(String, int, int, DataType) but with the default datatype, Eye.DEFAULT_DTYPE- Parameters:
rows- Number of rowscols- Number of columns- Returns:
- output (NUMERIC type)
-
eye
public SDVariable eye(String name, int rows, int cols)
As per eye(String, int, int, DataType) but with the default datatype, Eye.DEFAULT_DTYPE- Parameters:
name- name May be null. Name for the output variablerows- Number of rowscols- Number of columns- Returns:
- output (NUMERIC type)
-
eye
public SDVariable eye(int rows, int cols, DataType dataType, int... dimensions)
Generate an identity matrix with the specified number of rows and columns
Example:
INDArray eye = eye(3,2)<br> eye:<br> [ 1, 0]<br> [ 0, 1]<br> [ 0, 0]
- Parameters:
rows- Number of rowscols- Number of columnsdataType- Data typedimensions- (Size: AtLeast(min=0))- Returns:
- output Identity matrix (NUMERIC type)
-
eye
public SDVariable eye(String name, int rows, int cols, DataType dataType, int... dimensions)
Generate an identity matrix with the specified number of rows and columns
Example:
INDArray eye = eye(3,2)<br> eye:<br> [ 1, 0]<br> [ 0, 1]<br> [ 0, 0]
- Parameters:
name- name May be null. Name for the output variablerows- Number of rowscols- Number of columnsdataType- Data typedimensions- (Size: AtLeast(min=0))- Returns:
- output Identity matrix (NUMERIC type)
-
eye
public SDVariable eye(SDVariable rows, SDVariable cols)
As per eye(int, int) bit with the number of rows/columns specified as scalar INDArrays- Parameters:
rows- Number of rows (INT type)cols- Number of columns (INT type)- Returns:
- output Identity matrix (NUMERIC type)
-
eye
public SDVariable eye(String name, SDVariable rows, SDVariable cols)
As per eye(int, int) bit with the number of rows/columns specified as scalar INDArrays- Parameters:
name- name May be null. Name for the output variablerows- Number of rows (INT type)cols- Number of columns (INT type)- Returns:
- output Identity matrix (NUMERIC type)
-
eye
public SDVariable eye(SDVariable rows)
As per eye(String, int) but with the number of rows specified as a scalar INDArray- Parameters:
rows- Number of rows (INT type)- Returns:
- output SDVaribable identity matrix (NUMERIC type)
-
eye
public SDVariable eye(String name, SDVariable rows)
As per eye(String, int) but with the number of rows specified as a scalar INDArray- Parameters:
name- name May be null. Name for the output variablerows- Number of rows (INT type)- Returns:
- output SDVaribable identity matrix (NUMERIC type)
-
firstIndex
public SDVariable firstIndex(SDVariable 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. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions=[1] then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]- Parameters:
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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
firstIndex
public SDVariable firstIndex(String name, SDVariable 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. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions=[1] then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]- Parameters:
name- name May be null. Name for the output variablein- 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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
firstIndex
public SDVariable firstIndex(SDVariable 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. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions=[1] then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]- Parameters:
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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
firstIndex
public SDVariable firstIndex(String name, SDVariable 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. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions=[1] then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]- Parameters:
name- name May be null. Name for the output variablein- 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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
floor
public SDVariable floor(SDVariable x)
Element-wise floor function: out = floor(x).
Rounds each value down to the nearest integer value (if not already an integer)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
floor
public SDVariable floor(String name, SDVariable x)
Element-wise floor function: out = floor(x).
Rounds each value down to the nearest integer value (if not already an integer)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
floorDiv
public SDVariable floorDiv(SDVariable x, SDVariable y)
Pairwise floor division operation, out = floor(x / y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
floorDiv
public SDVariable floorDiv(String name, SDVariable x, SDVariable y)
Pairwise floor division operation, out = floor(x / y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
floorMod
public SDVariable floorMod(SDVariable x, SDVariable y)
Pairwise Modulus division operation
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
floorMod
public SDVariable floorMod(String name, SDVariable x, SDVariable y)
Pairwise Modulus division operation
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
floorMod
public SDVariable floorMod(SDVariable x, double value)
Scalar floor modulus operation- Parameters:
x- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
floorMod
public SDVariable floorMod(String name, SDVariable x, double value)
Scalar floor modulus operation- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
hammingDistance
public SDVariable hammingDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Hamming distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = count( x[i] != y[i] )- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
hammingDistance
public SDVariable hammingDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Hamming distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = count( x[i] != y[i] )- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
hammingDistance
public SDVariable hammingDistance(SDVariable x, SDVariable y, int... dimensions)
Hamming distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = count( x[i] != y[i] )- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
hammingDistance
public SDVariable hammingDistance(String name, SDVariable x, SDVariable y, int... dimensions)
Hamming distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = count( x[i] != y[i] )- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
iamax
public SDVariable iamax(SDVariable in, int... dimensions)
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
iamax
public SDVariable iamax(String name, SDVariable in, int... dimensions)
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
iamax
public SDVariable iamax(SDVariable in, boolean keepDims, int... dimensions)
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)- Parameters:
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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
iamax
public SDVariable iamax(String name, SDVariable in, boolean keepDims, int... dimensions)
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)- Parameters:
name- name May be null. Name for the output variablein- 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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
iamin
public SDVariable iamin(SDVariable in, int... dimensions)
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
iamin
public SDVariable iamin(String name, SDVariable in, int... dimensions)
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
iamin
public SDVariable iamin(SDVariable in, boolean keepDims, int... dimensions)
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)- Parameters:
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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
iamin
public SDVariable iamin(String name, SDVariable in, boolean keepDims, int... dimensions)
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)- Parameters:
name- name May be null. Name for the output variablein- 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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
isFinite
public SDVariable isFinite(SDVariable 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- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
isFinite
public SDVariable isFinite(String name, SDVariable 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- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
isInfinite
public SDVariable isInfinite(SDVariable 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- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
isInfinite
public SDVariable isInfinite(String name, SDVariable 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- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
isMax
public SDVariable isMax(SDVariable 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- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
isMax
public SDVariable isMax(String name, SDVariable 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- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
isNaN
public SDVariable isNaN(SDVariable 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- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
isNaN
public SDVariable isNaN(String name, SDVariable 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- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
isNonDecreasing
public SDVariable isNonDecreasing(SDVariable x)
Is the array non decreasing?
An array is non-decreasing if for every valid i, x[i] <= x[i+1]. For Rank 2+ arrays, values are compared
in 'c' (row major) order- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Scalar variable with value 1 if non-decreasing, or 0 otherwise (NUMERIC type)
-
isNonDecreasing
public SDVariable isNonDecreasing(String name, SDVariable x)
Is the array non decreasing?
An array is non-decreasing if for every valid i, x[i] <= x[i+1]. For Rank 2+ arrays, values are compared
in 'c' (row major) order- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Scalar variable with value 1 if non-decreasing, or 0 otherwise (NUMERIC type)
-
isStrictlyIncreasing
public SDVariable isStrictlyIncreasing(SDVariable x)
Is the array strictly increasing?
An array is strictly increasing if for every valid i, x[i] < x[i+1]. For Rank 2+ arrays, values are compared
in 'c' (row major) order- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Scalar variable with value 1 if strictly increasing, or 0 otherwise (NUMERIC type)
-
isStrictlyIncreasing
public SDVariable isStrictlyIncreasing(String name, SDVariable x)
Is the array strictly increasing?
An array is strictly increasing if for every valid i, x[i] < x[i+1]. For Rank 2+ arrays, values are compared
in 'c' (row major) order- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Scalar variable with value 1 if strictly increasing, or 0 otherwise (NUMERIC type)
-
jaccardDistance
public SDVariable jaccardDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Jaccard similarity reduction operation. The output contains the Jaccard distance for each
tensor along the specified dimensions.- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
jaccardDistance
public SDVariable jaccardDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Jaccard similarity reduction operation. The output contains the Jaccard distance for each
tensor along the specified dimensions.- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
jaccardDistance
public SDVariable jaccardDistance(SDVariable x, SDVariable y, int... dimensions)
Jaccard similarity reduction operation. The output contains the Jaccard distance for each
tensor along the specified dimensions.- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
jaccardDistance
public SDVariable jaccardDistance(String name, SDVariable x, SDVariable y, int... dimensions)
Jaccard similarity reduction operation. The output contains the Jaccard distance for each
tensor along the specified dimensions.- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
lastIndex
public SDVariable lastIndex(SDVariable 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. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions=[1] then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]- Parameters:
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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
lastIndex
public SDVariable lastIndex(String name, SDVariable 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. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions=[1] then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]- Parameters:
name- name May be null. Name for the output variablein- 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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
lastIndex
public SDVariable lastIndex(SDVariable 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. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions=[1] then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]- Parameters:
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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
lastIndex
public SDVariable lastIndex(String name, SDVariable 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. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions=[1] then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]- Parameters:
name- name May be null. Name for the output variablein- 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))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
listDiff
public SDVariable[] listDiff(SDVariable x, SDVariable y)
Calculates difference between inputs X and Y.- Parameters:
x- Input variable X (NUMERIC type)y- Input variable Y (NUMERIC type)
-
listDiff
public SDVariable[] listDiff(String[] names, SDVariable x, SDVariable y)
Calculates difference between inputs X and Y.- Parameters:
names- names May be null. Arrays of names for the output variables.x- Input variable X (NUMERIC type)y- Input variable Y (NUMERIC type)
-
log
public SDVariable log(SDVariable x)
Element-wise logarithm function (base e - natural logarithm): out = log(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
log
public SDVariable log(String name, SDVariable x)
Element-wise logarithm function (base e - natural logarithm): out = log(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
log
public SDVariable log(SDVariable x, double base)
Element-wise logarithm function (with specified base): out = log_{base}(x)- Parameters:
x- Input variable (NUMERIC type)base- Logarithm base- Returns:
- output Output variable (NUMERIC type)
-
log
public SDVariable log(String name, SDVariable x, double base)
Element-wise logarithm function (with specified base): out = log_{base}(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)base- Logarithm base- Returns:
- output Output variable (NUMERIC type)
-
log1p
public SDVariable log1p(SDVariable x)
Elementwise natural logarithm function: out = log_e (1 + x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
log1p
public SDVariable log1p(String name, SDVariable x)
Elementwise natural logarithm function: out = log_e (1 + x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
logEntropy
public SDVariable logEntropy(SDVariable in, boolean keepDims, int... dimensions)
Log entropy reduction: log(-sum(x * log(x)))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
logEntropy
public SDVariable logEntropy(String name, SDVariable in, boolean keepDims, int... dimensions)
Log entropy reduction: log(-sum(x * log(x)))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
logEntropy
public SDVariable logEntropy(SDVariable in, int... dimensions)
Log entropy reduction: log(-sum(x * log(x)))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
logEntropy
public SDVariable logEntropy(String name, SDVariable in, int... dimensions)
Log entropy reduction: log(-sum(x * log(x)))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
logSumExp
public SDVariable logSumExp(SDVariable input, int... dimensions)
Log-sum-exp reduction (optionally along dimension).
Computes log(sum(exp(x))- Parameters:
input- Input variable (NUMERIC type)dimensions- Optional dimensions to reduce along (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
logSumExp
public SDVariable logSumExp(String name, SDVariable input, int... dimensions)
Log-sum-exp reduction (optionally along dimension).
Computes log(sum(exp(x))- Parameters:
name- name May be null. Name for the output variableinput- Input variable (NUMERIC type)dimensions- Optional dimensions to reduce along (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
manhattanDistance
public SDVariable manhattanDistance(SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Manhattan distance (l1 norm, l1 distance) reduction operation. The output contains the Manhattan distance for each
tensor/subset along the specified dimensions:
out = sum_i abs(x[i]-y[i])- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
manhattanDistance
public SDVariable manhattanDistance(String name, SDVariable x, SDVariable y, boolean keepDims, boolean isComplex, int... dimensions)
Manhattan distance (l1 norm, l1 distance) reduction operation. The output contains the Manhattan distance for each
tensor/subset along the specified dimensions:
out = sum_i abs(x[i]-y[i])- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)keepDims- Whether to preserve original dimensions or notisComplex- Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
manhattanDistance
public SDVariable manhattanDistance(SDVariable x, SDVariable y, int... dimensions)
Manhattan distance (l1 norm, l1 distance) reduction operation. The output contains the Manhattan distance for each
tensor/subset along the specified dimensions:
out = sum_i abs(x[i]-y[i])- Parameters:
x- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
manhattanDistance
public SDVariable manhattanDistance(String name, SDVariable x, SDVariable y, int... dimensions)
Manhattan distance (l1 norm, l1 distance) reduction operation. The output contains the Manhattan distance for each
tensor/subset along the specified dimensions:
out = sum_i abs(x[i]-y[i])- Parameters:
name- name May be null. Name for the output variablex- Input variable x (NUMERIC type)y- Input variable y (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Output variable (NUMERIC type)
-
matrixDeterminant
public SDVariable matrixDeterminant(SDVariable in)
Matrix determinant op. For 2D input, this returns the standard matrix determinant.
For higher dimensional input with shape [..., m, m] the matrix determinant is returned for each
shape [m,m] sub-matrix.- Parameters:
in- Input (NUMERIC type)- Returns:
- output Matrix determinant variable (NUMERIC type)
-
matrixDeterminant
public SDVariable matrixDeterminant(String name, SDVariable in)
Matrix determinant op. For 2D input, this returns the standard matrix determinant.
For higher dimensional input with shape [..., m, m] the matrix determinant is returned for each
shape [m,m] sub-matrix.- Parameters:
name- name May be null. Name for the output variablein- Input (NUMERIC type)- Returns:
- output Matrix determinant variable (NUMERIC type)
-
matrixInverse
public SDVariable matrixInverse(SDVariable in)
Matrix inverse op. For 2D input, this returns the standard matrix inverse.
For higher dimensional input with shape [..., m, m] the matrix inverse is returned for each
shape [m,m] sub-matrix.- Parameters:
in- Input (NUMERIC type)- Returns:
- output Matrix inverse variable (NUMERIC type)
-
matrixInverse
public SDVariable matrixInverse(String name, SDVariable in)
Matrix inverse op. For 2D input, this returns the standard matrix inverse.
For higher dimensional input with shape [..., m, m] the matrix inverse is returned for each
shape [m,m] sub-matrix.- Parameters:
name- name May be null. Name for the output variablein- Input (NUMERIC type)- Returns:
- output Matrix inverse variable (NUMERIC type)
-
max
public SDVariable max(SDVariable x, SDVariable y)
Pairwise max operation, out = max(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- First input variable, x (NUMERIC type)y- Second input variable, y (NUMERIC type)- Returns:
- out Output (NUMERIC type)
-
max
public SDVariable max(String name, SDVariable x, SDVariable y)
Pairwise max operation, out = max(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- First input variable, x (NUMERIC type)y- Second input variable, y (NUMERIC type)- Returns:
- out Output (NUMERIC type)
-
mean
public SDVariable mean(SDVariable in, boolean keepDims, int... dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
mean
public SDVariable mean(String name, SDVariable in, boolean keepDims, int... dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
mean
public SDVariable mean(SDVariable in, int... dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
mean
public SDVariable mean(String name, SDVariable in, int... dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
mean
public SDVariable mean(SDVariable in, SDVariable dimensions, boolean keepDims)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
mean
public SDVariable mean(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
mean
public SDVariable mean(SDVariable in, SDVariable dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
mean
public SDVariable mean(String name, SDVariable in, SDVariable dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
mergeAdd
public SDVariable mergeAdd(SDVariable... inputs)
Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]- Parameters:
inputs- Input variables (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
mergeAdd
public SDVariable mergeAdd(String name, SDVariable... inputs)
Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]- Parameters:
name- name May be null. Name for the output variableinputs- Input variables (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
mergeAvg
public SDVariable mergeAvg(SDVariable... inputs)
Merge average function: merges an arbitrary number of equal shaped arrays using element-wise mean operation:
out = mean_i in[i]- Parameters:
inputs- Input variables (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
mergeAvg
public SDVariable mergeAvg(String name, SDVariable... inputs)
Merge average function: merges an arbitrary number of equal shaped arrays using element-wise mean operation:
out = mean_i in[i]- Parameters:
name- name May be null. Name for the output variableinputs- Input variables (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
mergeMax
public SDVariable mergeMax(SDVariable... inputs)
Merge max function: merges an arbitrary number of equal shaped arrays using element-wise maximum operation:
out = max_i in[i]- Parameters:
inputs- Input variables (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
mergeMax
public SDVariable mergeMax(String name, SDVariable... inputs)
Merge max function: merges an arbitrary number of equal shaped arrays using element-wise maximum operation:
out = max_i in[i]- Parameters:
name- name May be null. Name for the output variableinputs- Input variables (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
meshgrid
public SDVariable[] meshgrid(SDVariable[] inputs, boolean cartesian)
Broadcasts parameters for evaluation on an N-D grid.- Parameters:
inputs- (NUMERIC type)cartesian-
-
meshgrid
public SDVariable[] meshgrid(String[] names, SDVariable[] inputs, boolean cartesian)
Broadcasts parameters for evaluation on an N-D grid.- Parameters:
names- names May be null. Arrays of names for the output variables.inputs- (NUMERIC type)cartesian-
-
min
public SDVariable min(SDVariable x, SDVariable y)
Pairwise max operation, out = min(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- First input variable, x (NUMERIC type)y- Second input variable, y (NUMERIC type)- Returns:
- out Output (NUMERIC type)
-
min
public SDVariable min(String name, SDVariable x, SDVariable y)
Pairwise max operation, out = min(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- First input variable, x (NUMERIC type)y- Second input variable, y (NUMERIC type)- Returns:
- out Output (NUMERIC type)
-
mod
public SDVariable mod(SDVariable x, SDVariable y)
Pairwise modulus (remainder) operation, out = x % y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
mod
public SDVariable mod(String name, SDVariable x, SDVariable y)
Pairwise modulus (remainder) operation, out = x % y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
moments
public SDVariable[] moments(SDVariable input, int[] axes, boolean keepDims)
Calculate the mean and (population) variance for the input variable, for the specified axis- Parameters:
input- Input to calculate moments for (NUMERIC type)axes- Dimensions to perform calculation over (Size: AtLeast(min=0))keepDims- Whether to keep dimensions during reduction or not.
-
moments
public SDVariable[] moments(String[] names, SDVariable input, int[] axes, boolean keepDims)
Calculate the mean and (population) variance for the input variable, for the specified axis- Parameters:
names- names May be null. Arrays of names for the output variables.input- Input to calculate moments for (NUMERIC type)axes- Dimensions to perform calculation over (Size: AtLeast(min=0))keepDims- Whether to keep dimensions during reduction or not.
-
moments
public SDVariable[] moments(SDVariable input, SDVariable axes, boolean keepDims)
Calculate the mean and (population) variance for the input variable, for the specified axis- Parameters:
input- Input to calculate moments for (NUMERIC type)axes- Dimensions to perform calculation over (NUMERIC type)keepDims- Whether to keep dimensions during reduction or not.
-
moments
public SDVariable[] moments(String[] names, SDVariable input, SDVariable axes, boolean keepDims)
Calculate the mean and (population) variance for the input variable, for the specified axis- Parameters:
names- names May be null. Arrays of names for the output variables.input- Input to calculate moments for (NUMERIC type)axes- Dimensions to perform calculation over (NUMERIC type)keepDims- Whether to keep dimensions during reduction or not.
-
mul
public SDVariable mul(SDVariable x, SDVariable y)
Pairwise multiplication operation, out = x * y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
mul
public SDVariable mul(String name, SDVariable x, SDVariable y)
Pairwise multiplication operation, out = x * y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
mul
public SDVariable mul(SDVariable x, double value)
Scalar multiplication operation, out = in * scalar- Parameters:
x- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
mul
public SDVariable mul(String name, SDVariable x, double value)
Scalar multiplication operation, out = in * scalar- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
neg
public SDVariable neg(SDVariable x)
Elementwise negative operation: out = -x- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
neg
public SDVariable neg(String name, SDVariable x)
Elementwise negative operation: out = -x- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
norm1
public SDVariable norm1(SDVariable in, boolean keepDims, int... dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm1
public SDVariable norm1(String name, SDVariable in, boolean keepDims, int... dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm1
public SDVariable norm1(SDVariable in, int... dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm1
public SDVariable norm1(String name, SDVariable in, int... dimensions)
Mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm1
public SDVariable norm1(SDVariable in, SDVariable dimensions, boolean keepDims)
Sum of absolute differences.- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm1
public SDVariable norm1(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Sum of absolute differences.- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm1
public SDVariable norm1(SDVariable in, SDVariable dimensions)
Sum of absolute differences.- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm1
public SDVariable norm1(String name, SDVariable in, SDVariable dimensions)
Sum of absolute differences.- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm2
public SDVariable norm2(SDVariable in, boolean keepDims, int... dimensions)
Euclidean norm: euclidean distance of a vector from the origin- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm2
public SDVariable norm2(String name, SDVariable in, boolean keepDims, int... dimensions)
Euclidean norm: euclidean distance of a vector from the origin- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm2
public SDVariable norm2(SDVariable in, int... dimensions)
Euclidean norm: euclidean distance of a vector from the origin- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm2
public SDVariable norm2(String name, SDVariable in, int... dimensions)
Euclidean norm: euclidean distance of a vector from the origin- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm2
public SDVariable norm2(SDVariable in, SDVariable dimensions, boolean keepDims)
Euclidean norm: euclidean distance of a vector from the origin- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm2
public SDVariable norm2(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Euclidean norm: euclidean distance of a vector from the origin- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm2
public SDVariable norm2(SDVariable in, SDVariable dimensions)
Euclidean norm: euclidean distance of a vector from the origin- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
norm2
public SDVariable norm2(String name, SDVariable in, SDVariable dimensions)
Euclidean norm: euclidean distance of a vector from the origin- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
normMax
public SDVariable normMax(SDVariable in, boolean keepDims, int... dimensions)
Differences between max absolute value- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
normMax
public SDVariable normMax(String name, SDVariable in, boolean keepDims, int... dimensions)
Differences between max absolute value- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
normMax
public SDVariable normMax(SDVariable in, int... dimensions)
Differences between max absolute value- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
normMax
public SDVariable normMax(String name, SDVariable in, int... dimensions)
Differences between max absolute value- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
normMax
public SDVariable normMax(SDVariable in, SDVariable dimensions, boolean keepDims)
Differences between max absolute value- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
normMax
public SDVariable normMax(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Differences between max absolute value- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
normMax
public SDVariable normMax(SDVariable in, SDVariable dimensions)
Differences between max absolute value- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
normMax
public SDVariable normMax(String name, SDVariable in, SDVariable dimensions)
Differences between max absolute value- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
normalizeMoments
public SDVariable[] normalizeMoments(SDVariable counts, SDVariable means, SDVariable variances, double shift)
Calculate the mean and variance from the sufficient statistics- Parameters:
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)
-
normalizeMoments
public SDVariable[] normalizeMoments(String[] names, SDVariable counts, SDVariable means, SDVariable variances, double shift)
Calculate the mean and variance from the sufficient statistics- Parameters:
names- names May be null. Arrays of names for the output variables.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)
-
or
public SDVariable or(SDVariable x, SDVariable 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.- Parameters:
x- Input 1 (BOOL type)y- Input 2 (BOOL type)- Returns:
- output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
-
or
public SDVariable or(String name, SDVariable x, SDVariable 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.- Parameters:
name- name May be null. Name for the output variablex- Input 1 (BOOL type)y- Input 2 (BOOL type)- Returns:
- output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
-
pow
public SDVariable pow(SDVariable x, double value)
Element-wise power function: out = x^value- Parameters:
x- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
pow
public SDVariable pow(String name, SDVariable x, double value)
Element-wise power function: out = x^value- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
pow
public SDVariable pow(SDVariable x, SDVariable y)
Element-wise (broadcastable) power function: out = x[i]^y[i]- Parameters:
x- Input variable (NUMERIC type)y- Power (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
pow
public SDVariable pow(String name, SDVariable x, SDVariable y)
Element-wise (broadcastable) power function: out = x[i]^y[i]- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Power (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
prod
public SDVariable prod(SDVariable in, boolean keepDims, int... dimensions)
The max of an array along each dimension- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
prod
public SDVariable prod(String name, SDVariable in, boolean keepDims, int... dimensions)
The max of an array along each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
prod
public SDVariable prod(SDVariable in, int... dimensions)
The max of an array along each dimension- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
prod
public SDVariable prod(String name, SDVariable in, int... dimensions)
The max of an array along each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
prod
public SDVariable prod(SDVariable in, SDVariable dimensions, boolean keepDims)
The product of an array long each dimension- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
prod
public SDVariable prod(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
The product of an array long each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
prod
public SDVariable prod(SDVariable in, SDVariable dimensions)
The product of an array long each dimension- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
prod
public SDVariable prod(String name, SDVariable in, SDVariable dimensions)
The product of an array long each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
rationalTanh
public SDVariable rationalTanh(SDVariable x)
Rational Tanh Approximation elementwise function, as described in the paper:
Compact Convolutional Neural Network Cascade for Face Detection
This is a faster Tanh approximation- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rationalTanh
public SDVariable rationalTanh(String name, SDVariable x)
Rational Tanh Approximation elementwise function, as described in the paper:
Compact Convolutional Neural Network Cascade for Face Detection
This is a faster Tanh approximation- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rdiv
public SDVariable rdiv(SDVariable x, SDVariable y)
Pairwise reverse division operation, out = y / x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rdiv
public SDVariable rdiv(String name, SDVariable x, SDVariable y)
Pairwise reverse division operation, out = y / x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rdiv
public SDVariable rdiv(SDVariable x, double value)
Scalar reverse division operation, out = scalar / in- Parameters:
x- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
rdiv
public SDVariable rdiv(String name, SDVariable x, double value)
Scalar reverse division operation, out = scalar / in- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
reciprocal
public SDVariable reciprocal(SDVariable x)
Element-wise reciprocal (inverse) function: out[i] = 1 / in[i]- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
reciprocal
public SDVariable reciprocal(String name, SDVariable x)
Element-wise reciprocal (inverse) function: out[i] = 1 / in[i]- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rectifiedTanh
public SDVariable rectifiedTanh(SDVariable x)
Rectified tanh operation: max(0, tanh(in))- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rectifiedTanh
public SDVariable rectifiedTanh(String name, SDVariable x)
Rectified tanh operation: max(0, tanh(in))- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
reduceAMax
public SDVariable reduceAMax(SDVariable in, boolean keepDims, int... dimensions)
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAMax
public SDVariable reduceAMax(String name, SDVariable in, boolean keepDims, int... dimensions)
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAMax
public SDVariable reduceAMax(SDVariable in, int... dimensions)
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAMax
public SDVariable reduceAMax(String name, SDVariable in, int... dimensions)
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAMax
public SDVariable reduceAMax(SDVariable in, SDVariable dimensions, boolean keepDims)
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAMax
public SDVariable reduceAMax(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAMax
public SDVariable reduceAMax(SDVariable in, SDVariable dimensions)
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAMax
public SDVariable reduceAMax(String name, SDVariable in, SDVariable dimensions)
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmean
public SDVariable reduceAmean(SDVariable in, boolean keepDims, int... dimensions)
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmean
public SDVariable reduceAmean(String name, SDVariable in, boolean keepDims, int... dimensions)
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmean
public SDVariable reduceAmean(SDVariable in, int... dimensions)
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmean
public SDVariable reduceAmean(String name, SDVariable in, int... dimensions)
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmean
public SDVariable reduceAmean(SDVariable in, SDVariable dimensions, boolean keepDims)
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmean
public SDVariable reduceAmean(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmean
public SDVariable reduceAmean(SDVariable in, SDVariable dimensions)
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmean
public SDVariable reduceAmean(String name, SDVariable in, SDVariable dimensions)
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmin
public SDVariable reduceAmin(SDVariable in, boolean keepDims, int... dimensions)
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmin
public SDVariable reduceAmin(String name, SDVariable in, boolean keepDims, int... dimensions)
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmin
public SDVariable reduceAmin(SDVariable in, int... dimensions)
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmin
public SDVariable reduceAmin(String name, SDVariable in, int... dimensions)
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmin
public SDVariable reduceAmin(SDVariable in, SDVariable dimensions, boolean keepDims)
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmin
public SDVariable reduceAmin(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmin
public SDVariable reduceAmin(SDVariable in, SDVariable dimensions)
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceAmin
public SDVariable reduceAmin(String name, SDVariable in, SDVariable dimensions)
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMax
public SDVariable reduceMax(SDVariable in, boolean keepDims, int... dimensions)
The max of an array along each dimension- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMax
public SDVariable reduceMax(String name, SDVariable in, boolean keepDims, int... dimensions)
The max of an array along each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMax
public SDVariable reduceMax(SDVariable in, int... dimensions)
The max of an array along each dimension- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMax
public SDVariable reduceMax(String name, SDVariable in, int... dimensions)
The max of an array along each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMax
public SDVariable reduceMax(SDVariable in, SDVariable dimensions, boolean keepDims)
The max of an array long each dimension- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMax
public SDVariable reduceMax(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
The max of an array long each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMax
public SDVariable reduceMax(SDVariable in, SDVariable dimensions)
The max of an array long each dimension- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMax
public SDVariable reduceMax(String name, SDVariable in, SDVariable dimensions)
The max of an array long each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMin
public SDVariable reduceMin(SDVariable in, boolean keepDims, int... dimensions)
The minimum of an array along each dimension- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMin
public SDVariable reduceMin(String name, SDVariable in, boolean keepDims, int... dimensions)
The minimum of an array along each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMin
public SDVariable reduceMin(SDVariable in, int... dimensions)
The minimum of an array along each dimension- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMin
public SDVariable reduceMin(String name, SDVariable in, int... dimensions)
The minimum of an array along each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMin
public SDVariable reduceMin(SDVariable in, SDVariable dimensions, boolean keepDims)
The minimum of an array long each dimension- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMin
public SDVariable reduceMin(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
The minimum of an array long each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMin
public SDVariable reduceMin(SDVariable in, SDVariable dimensions)
The minimum of an array long each dimension- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
reduceMin
public SDVariable reduceMin(String name, SDVariable in, SDVariable dimensions)
The minimum of an array long each dimension- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
round
public SDVariable round(SDVariable x)
Element-wise round function: out = round(x).
Rounds (up or down depending on value) to the nearest integer value.- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
round
public SDVariable round(String name, SDVariable x)
Element-wise round function: out = round(x).
Rounds (up or down depending on value) to the nearest integer value.- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rsqrt
public SDVariable rsqrt(SDVariable x)
Element-wise reciprocal (inverse) of square root: out = 1.0 / sqrt(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rsqrt
public SDVariable rsqrt(String name, SDVariable x)
Element-wise reciprocal (inverse) of square root: out = 1.0 / sqrt(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rsub
public SDVariable rsub(SDVariable x, SDVariable y)
Pairwise reverse subtraction operation, out = y - x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rsub
public SDVariable rsub(String name, SDVariable x, SDVariable y)
Pairwise reverse subtraction operation, out = y - x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
rsub
public SDVariable rsub(SDVariable x, double value)
Scalar reverse subtraction operation, out = scalar - in- Parameters:
x- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
rsub
public SDVariable rsub(String name, SDVariable x, double value)
Scalar reverse subtraction operation, out = scalar - in- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
setDiag
public SDVariable setDiag(SDVariable in, SDVariable 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]- Parameters:
in- Input variable (NUMERIC type)diag- Diagonal (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
setDiag
public SDVariable setDiag(String name, SDVariable in, SDVariable 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]- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)diag- Diagonal (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
shannonEntropy
public SDVariable shannonEntropy(SDVariable in, boolean keepDims, int... dimensions)
Shannon Entropy reduction: -sum(x * log2(x))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
shannonEntropy
public SDVariable shannonEntropy(String name, SDVariable in, boolean keepDims, int... dimensions)
Shannon Entropy reduction: -sum(x * log2(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
shannonEntropy
public SDVariable shannonEntropy(SDVariable in, int... dimensions)
Shannon Entropy reduction: -sum(x * log2(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
shannonEntropy
public SDVariable shannonEntropy(String name, SDVariable in, int... dimensions)
Shannon Entropy reduction: -sum(x * log2(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
shannonEntropy
public SDVariable shannonEntropy(SDVariable in, SDVariable dimensions, boolean keepDims)
Shannon Entropy reduction: -sum(x * log2(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
shannonEntropy
public SDVariable shannonEntropy(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Shannon Entropy reduction: -sum(x * log2(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
shannonEntropy
public SDVariable shannonEntropy(SDVariable in, SDVariable dimensions)
Shannon Entropy reduction: -sum(x * log2(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
shannonEntropy
public SDVariable shannonEntropy(String name, SDVariable in, SDVariable dimensions)
Shannon Entropy reduction: -sum(x * log2(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
sign
public SDVariable sign(SDVariable x)
Element-wise sign (signum) function:
out = -1 if in < 0
out = 0 if in = 0
out = 1 if in > 0- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
sign
public SDVariable sign(String name, SDVariable x)
Element-wise sign (signum) function:
out = -1 if in < 0
out = 0 if in = 0
out = 1 if in > 0- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
sin
public SDVariable sin(SDVariable x)
Elementwise sine operation: out = sin(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
sin
public SDVariable sin(String name, SDVariable x)
Elementwise sine operation: out = sin(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
sinh
public SDVariable sinh(SDVariable x)
Elementwise sinh (hyperbolic sine) operation: out = sinh(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
sinh
public SDVariable sinh(String name, SDVariable x)
Elementwise sinh (hyperbolic sine) operation: out = sinh(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
sqrt
public SDVariable sqrt(SDVariable x)
Element-wise square root function: out = sqrt(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
sqrt
public SDVariable sqrt(String name, SDVariable x)
Element-wise square root function: out = sqrt(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
square
public SDVariable square(SDVariable x)
Element-wise square function: out = x^2- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
square
public SDVariable square(String name, SDVariable x)
Element-wise square function: out = x^2- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
squaredDifference
public SDVariable squaredDifference(SDVariable x, SDVariable y)
Pairwise squared difference operation.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
squaredDifference
public SDVariable squaredDifference(String name, SDVariable x, SDVariable y)
Pairwise squared difference operation.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
squaredNorm
public SDVariable squaredNorm(SDVariable in, boolean keepDims, int... dimensions)
Sum of squared differences.- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
squaredNorm
public SDVariable squaredNorm(String name, SDVariable in, boolean keepDims, int... dimensions)
Sum of squared differences.- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
squaredNorm
public SDVariable squaredNorm(SDVariable in, int... dimensions)
Sum of squared differences.- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
squaredNorm
public SDVariable squaredNorm(String name, SDVariable in, int... dimensions)
Sum of squared differences.- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
squaredNorm
public SDVariable squaredNorm(SDVariable in, SDVariable dimensions, boolean keepDims)
Sum of squared differences.- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
squaredNorm
public SDVariable squaredNorm(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Sum of squared differences.- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
squaredNorm
public SDVariable squaredNorm(SDVariable in, SDVariable dimensions)
Sum of squared differences.- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
squaredNorm
public SDVariable squaredNorm(String name, SDVariable in, SDVariable dimensions)
Sum of squared differences.- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
standardize
public SDVariable standardize(SDVariable x, int... dimensions)
Standardize input variable along given axis
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]:
- use dimension 1 too use the statistics (mean, stdev) for each example
- use dimension 0 if you want to use the statistics for each column across all examples
- use dimensions 0,1 if you want to use the statistics across all columns and examples
- Parameters:
x- Input variable (NUMERIC type)dimensions- (Size: AtLeast(min=1))- Returns:
- output Output variable (NUMERIC type)
-
standardize
public SDVariable standardize(String name, SDVariable x, int... dimensions)
Standardize input variable along given axis
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]:
- use dimension 1 too use the statistics (mean, stdev) for each example
- use dimension 0 if you want to use the statistics for each column across all examples
- use dimensions 0,1 if you want to use the statistics across all columns and examples
- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)dimensions- (Size: AtLeast(min=1))- Returns:
- output Output variable (NUMERIC type)
-
step
public SDVariable step(SDVariable x, double value)
Elementwise step function:
out(x) = 1 if x >= cutoff
out(x) = 0 otherwise- Parameters:
x- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
step
public SDVariable step(String name, SDVariable x, double value)
Elementwise step function:
out(x) = 1 if x >= cutoff
out(x) = 0 otherwise- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
sub
public SDVariable sub(SDVariable x, SDVariable y)
Pairwise subtraction operation, out = x - y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
x- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
sub
public SDVariable sub(String name, SDVariable x, SDVariable y)
Pairwise subtraction operation, out = x - y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)y- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
sub
public SDVariable sub(SDVariable x, double value)
Scalar subtraction operation, out = in - scalar- Parameters:
x- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
sub
public SDVariable sub(String name, SDVariable x, double value)
Scalar subtraction operation, out = in - scalar- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)value- Scalar value for op- Returns:
- output Output variable (NUMERIC type)
-
sum
public SDVariable sum(SDVariable in, boolean keepDims, int... dimensions)
Sum of an array, optionally along specified dimensions: out = sum(x))- Parameters:
in- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
sum
public SDVariable sum(String name, SDVariable in, boolean keepDims, int... dimensions)
Sum of an array, optionally along specified dimensions: out = sum(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensionsdimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
sum
public SDVariable sum(SDVariable in, int... dimensions)
Sum of an array, optionally along specified dimensions: out = sum(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
sum
public SDVariable sum(String name, SDVariable in, int... dimensions)
Sum of an array, optionally along specified dimensions: out = sum(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
sum
public SDVariable sum(SDVariable in, SDVariable dimensions, boolean keepDims)
Sum of an array, optionally along specified dimensions: out = sum(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
sum
public SDVariable sum(String name, SDVariable in, SDVariable dimensions, boolean keepDims)
Sum of an array, optionally along specified dimensions: out = sum(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)keepDims- Whether to keep the original dimensions or produce a shrunk array with less dimensions- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
sum
public SDVariable sum(SDVariable in, SDVariable dimensions)
Sum of an array, optionally along specified dimensions: out = sum(x))- Parameters:
in- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
sum
public SDVariable sum(String name, SDVariable in, SDVariable dimensions)
Sum of an array, optionally along specified dimensions: out = sum(x))- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)dimensions- Dimensions to reduce along (NUMERIC type)- Returns:
- output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
-
tan
public SDVariable tan(SDVariable x)
Elementwise tangent operation: out = tan(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
tan
public SDVariable tan(String name, SDVariable x)
Elementwise tangent operation: out = tan(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
tanh
public SDVariable tanh(SDVariable x)
Elementwise tanh (hyperbolic tangent) operation: out = tanh(x)- Parameters:
x- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
tanh
public SDVariable tanh(String name, SDVariable x)
Elementwise tanh (hyperbolic tangent) operation: out = tanh(x)- Parameters:
name- name May be null. Name for the output variablex- Input variable (NUMERIC type)- Returns:
- output Output variable (NUMERIC type)
-
trace
public SDVariable trace(SDVariable in)
Matrix trace operation
For rank 2 matrices, the output is a scalar with the trace - i.e., sum of the main diagonal.
For higher rank inputs, output[a,b,c] = trace(in[a,b,c,:,:])- Parameters:
in- Input variable (NUMERIC type)- Returns:
- output Trace (NUMERIC type)
-
trace
public SDVariable trace(String name, SDVariable in)
Matrix trace operation
For rank 2 matrices, the output is a scalar with the trace - i.e., sum of the main diagonal.
For higher rank inputs, output[a,b,c] = trace(in[a,b,c,:,:])- Parameters:
name- name May be null. Name for the output variablein- Input variable (NUMERIC type)- Returns:
- output Trace (NUMERIC type)
-
xor
public SDVariable xor(SDVariable x, SDVariable 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.- Parameters:
x- Input 1 (BOOL type)y- Input 2 (BOOL type)- Returns:
- output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
-
xor
public SDVariable xor(String name, SDVariable x, SDVariable 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.- Parameters:
name- name May be null. Name for the output variablex- Input 1 (BOOL type)y- Input 2 (BOOL type)- Returns:
- output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
-
zeroFraction
public SDVariable zeroFraction(SDVariable input)
Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))- Parameters:
input- Input variable (NUMERIC type)- Returns:
- output Reduced array of rank 0 (scalar) (NUMERIC type)
-
zeroFraction
public SDVariable zeroFraction(String name, SDVariable input)
Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))- Parameters:
name- name May be null. Name for the output variableinput- Input variable (NUMERIC type)- Returns:
- output Reduced array of rank 0 (scalar) (NUMERIC type)
-
-