public class NDBase extends Object
Constructor and Description |
---|
NDBase() |
Modifier and Type | Method and Description |
---|---|
INDArray |
all(INDArray x,
int... dimensions)
Boolean and array reduction operation, optionally along specified dimensions
|
INDArray |
any(INDArray x,
int... dimensions)
Boolean or array reduction operation, optionally along specified dimensions
|
INDArray |
argmax(INDArray in,
boolean keepDims,
int... dimensions)
Argmax array reduction operation, optionally along specified dimensions.
Output values are the index of the maximum value of each slice along the specified dimension. Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
argmax(INDArray in,
int... dimensions)
Argmax array reduction operation, optionally along specified dimensions.
Output values are the index of the maximum value of each slice along the specified dimension. Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
argmin(INDArray in,
boolean keepDims,
int... dimensions)
Argmin array reduction operation, optionally along specified dimensions.
Output values are the index of the minimum value of each slice along the specified dimension. Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
argmin(INDArray in,
int... dimensions)
Argmin array reduction operation, optionally along specified dimensions.
Output values are the index of the minimum value of each slice along the specified dimension. Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray[] |
batchMmul(INDArray[] inputsA,
INDArray... inputsB)
Matrix multiply a batch of matrices.
|
INDArray[] |
batchMmul(INDArray[] inputsA,
INDArray[] inputsB,
boolean transposeA,
boolean transposeB)
Matrix multiply a batch of matrices.
|
INDArray |
castTo(INDArray arg,
DataType datatype)
Cast the array to a new datatype - for example, Integer -> Float
|
INDArray |
concat(int dimension,
INDArray... inputs)
Concatenate a set of inputs along the specified dimension.
Note that inputs must have identical rank and identical dimensions, other than the dimension to stack on. For example, if 2 inputs have shape [a, x, c] and [a, y, c] and dimension = 1, then the output has shape [a, x+y, c] Inputs must satisfy the following constraints: Input arrays must all be the same datatype: isSameType(inputs) |
INDArray |
cumprod(INDArray in,
boolean exclusive,
boolean reverse,
int... axis)
Cumulative product operation.
For input: [ a, b, c], output is: exclusive=false, reverse=false: [a, a*b, a*b*c] exclusive=true, reverse=false, [0, a, a*b] exclusive=false, reverse=true: [a*b*c, b*c, c] exclusive=true, reverse=true: [b*c, c, 0] |
INDArray |
cumprod(INDArray in,
int... axis)
Cumulative product operation.
For input: [ a, b, c], output is: exclusive=false, reverse=false: [a, a*b, a*b*c] exclusive=true, reverse=false, [0, a, a*b] exclusive=false, reverse=true: [a*b*c, b*c, c] exclusive=true, reverse=true: [b*c, c, 0] |
INDArray |
cumsum(INDArray in,
boolean exclusive,
boolean reverse,
int... axis)
Cumulative sum operation.
For input: [ a, b, c], output is: exclusive=false, reverse=false: [a, a+b, a+b+c] exclusive=true, reverse=false, [0, a, a+b] exclusive=false, reverse=true: [a+b+c, b+c, c] exclusive=true, reverse=true: [b+c, c, 0] |
INDArray |
cumsum(INDArray in,
int... axis)
Cumulative sum operation.
For input: [ a, b, c], output is: exclusive=false, reverse=false: [a, a+b, a+b+c] exclusive=true, reverse=false, [0, a, a+b] exclusive=false, reverse=true: [a+b+c, b+c, c] exclusive=true, reverse=true: [b+c, c, 0] |
INDArray |
dot(INDArray x,
INDArray y,
int... dimensions)
Pairwise dot product reduction along dimension
output = sum(i=0 ... |
INDArray[] |
dynamicPartition(INDArray x,
INDArray partitions,
int numPartitions)
Dynamically partition the input variable values into the specified number of paritions, using the indices.
Example: |
INDArray |
dynamicStitch(INDArray[] indices,
INDArray... x)
Dynamically merge the specified input arrays into a single array, using the specified indices
|
INDArray |
eq(INDArray x,
double y)
Equals operation: elementwise x == y
Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
eq(INDArray x,
INDArray y)
Equal to operation: elementwise x == y
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. 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 Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
expandDims(INDArray x,
int axis)
Reshape the input by adding a 1 at the specified location.
For example, if input has shape [a, b], then output shape is: axis = 0: [1, a, b] axis = 1: [a, 1, b] axis = 2: [a, b, 1] |
INDArray |
fill(INDArray shape,
DataType dataType,
double value)
Generate an output variable with the specified (dynamic) shape with all elements set to the specified value
|
INDArray |
gather(INDArray df,
INDArray indices,
int axis)
Gather slices from the input variable where the indices are specified as dynamic array values.
Output shape is same as input shape, except for axis dimension, which has size equal to indices.length. |
INDArray |
gather(INDArray df,
int[] indices,
int axis)
Gather slices from the input variable where the indices are specified as fixed int[] values.
Output shape is same as input shape, except for axis dimension, which has size equal to indices.length. |
INDArray |
gatherNd(INDArray df,
INDArray indices)
Gather slices from df with shape specified by indices.
|
INDArray |
gt(INDArray x,
double y)
Greater than operation: elementwise x > y
Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
gt(INDArray x,
INDArray y)
Greater than operation: elementwise x > y
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. 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 Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
gte(INDArray x,
double y)
Greater than or equals operation: elementwise x >= y
Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
gte(INDArray x,
INDArray y)
Greater than or equal to operation: elementwise x >= y
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. 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 Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
identity(INDArray input)
Elementwise identity operation: out = x
|
INDArray |
invertPermutation(INDArray input)
Compute the inverse permutation indices for a permutation operation
Example: if input is [2, 0, 1] then output is [1, 2, 0] The idea is that x.permute(input).permute(invertPermutation(input)) == x |
INDArray |
isNumericTensor(INDArray x)
Is the director a numeric tensor? In the current version of ND4J/SameDiff, this always returns true/1
|
INDArray |
linspace(DataType dataType,
double start,
double stop,
long number)
Create a new 1d array with values evenly spaced between values 'start' and 'stop'
For example, linspace(start=3.0, stop=4.0, number=3) will generate [3.0, 3.5, 4.0] |
INDArray |
linspace(INDArray start,
INDArray stop,
INDArray number,
DataType dataType)
Create a new 1d array with values evenly spaced between values 'start' and 'stop'
For example, linspace(start=3.0, stop=4.0, number=3) will generate [3.0, 3.5, 4.0] |
INDArray |
lt(INDArray x,
double y)
Less than operation: elementwise x < y
Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
lt(INDArray x,
INDArray y)
Less than operation: elementwise x < y
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. 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 Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
lte(INDArray x,
double y)
Less than or equals operation: elementwise x <= y
Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
lte(INDArray x,
INDArray y)
Less than or equal to operation: elementwise x <= y
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. 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 Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
matchCondition(INDArray in,
Condition condition)
Returns a boolean mask of equal shape to the input, where the condition is satisfied - value 1 where satisfied, 0 otherwise
|
INDArray |
matchConditionCount(INDArray in,
Condition condition)
Returns a count of the number of elements that satisfy the condition
|
INDArray |
matchConditionCount(INDArray in,
Condition condition,
boolean keepDim,
int... dimensions)
Returns a count of the number of elements that satisfy the condition (for each slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
matchConditionCount(INDArray in,
Condition condition,
int... dimensions)
Returns a count of the number of elements that satisfy the condition (for each slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
max(INDArray x,
boolean keepDims,
int... dimensions)
Max array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
max(INDArray first,
INDArray second)
Element-wise maximum operation: out[i] = max(first[i], second[i])
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 |
INDArray |
max(INDArray x,
int... dimensions)
Max array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
mean(INDArray x,
boolean keepDims,
int... dimensions)
Mean (average) array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
mean(INDArray x,
int... dimensions)
Mean (average) array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
merge(INDArray x,
INDArray y)
The merge operation is a control operation that forwards the either of the inputs to the output, when
the first of them becomes available. |
INDArray |
min(INDArray x,
boolean keepDims,
int... dimensions)
Minimum array reduction operation, optionally along specified dimensions.
|
INDArray |
min(INDArray first,
INDArray second)
Element-wise minimum operation: out[i] = min(first[i], second[i])
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 |
INDArray |
min(INDArray x,
int... dimensions)
Minimum array reduction operation, optionally along specified dimensions.
|
INDArray |
mmul(INDArray x,
INDArray y)
Matrix multiplication: out = mmul(x,y)
Supports specifying transpose argument to perform operation such as mmul(a^T, b), etc. |
INDArray |
mmul(INDArray x,
INDArray y,
boolean transposeX,
boolean transposeY,
boolean transposeZ)
Matrix multiplication: out = mmul(x,y)
Supports specifying transpose argument to perform operation such as mmul(a^T, b), etc. |
INDArray |
neq(INDArray x,
double y)
Not equals operation: elementwise x != y
Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
neq(INDArray x,
INDArray y)
Not equal to operation: elementwise x != y
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. 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 Return boolean array with values true where satisfied, or false otherwise. |
INDArray |
norm1(INDArray x,
boolean keepDims,
int... dimensions)
Norm1 (L1 norm) reduction operation: The output contains the L1 norm for each tensor/subset along the specified dimensions:
out = sum_i abs(x[i]) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
norm1(INDArray x,
int... dimensions)
Norm1 (L1 norm) reduction operation: The output contains the L1 norm for each tensor/subset along the specified dimensions:
out = sum_i abs(x[i]) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
norm2(INDArray x,
boolean keepDims,
int... dimensions)
Norm2 (L2 norm) reduction operation: The output contains the L2 norm for each tensor/subset along the specified dimensions:
out = sqrt(sum_i x[i]^2) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
norm2(INDArray x,
int... dimensions)
Norm2 (L2 norm) reduction operation: The output contains the L2 norm for each tensor/subset along the specified dimensions:
out = sqrt(sum_i x[i]^2) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
normmax(INDArray x,
boolean keepDims,
int... dimensions)
Max norm (infinity norm) reduction operation: The output contains the max norm for each tensor/subset along the
specified dimensions: out = max(abs(x[i])) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
normmax(INDArray x,
int... dimensions)
Max norm (infinity norm) reduction operation: The output contains the max norm for each tensor/subset along the
specified dimensions: out = max(abs(x[i])) Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
oneHot(INDArray indices,
int depth)
Convert the array to a one-hot array with walues 0 and 1 for each entry
If input has shape [ a, ..., n] then output has shape [ a, ..., n, depth], with out[i, ..., j, in[i,...,j]] = 1 with other values being set to 0 see oneHot(SDVariable, int, int, double, double) |
INDArray |
oneHot(INDArray indices,
int depth,
int axis,
double on,
double off)
Convert the array to a one-hot array with walues and for each entry
If input has shape [ a, ..., n] then output has shape [ a, ..., n, depth], with {out[i, ..., j, in[i,...,j]] with other values being set to |
INDArray |
oneHot(INDArray indices,
int depth,
int axis,
double on,
double off,
DataType dataType)
Convert the array to a one-hot array with walues and for each entry
If input has shape [ a, ..., n] then output has shape [ a, ..., n, depth], with {out[i, ..., j, in[i,...,j]] with other values being set to |
INDArray |
onesLike(INDArray input)
Return a variable of all 1s, with the same shape as the input variable.
|
INDArray |
onesLike(INDArray input,
DataType dataType)
As per onesLike(String, SDVariable) but the output datatype may be specified
|
INDArray |
permute(INDArray x,
INDArray dimensions)
Array permutation operation: permute the dimensions according to the specified permutation indices.
Example: if input has shape [a,b,c] and dimensions = [2,0,1] the output has shape [c,a,b] |
INDArray |
permute(INDArray x,
int... dimensions)
Array permutation operation: permute the dimensions according to the specified permutation indices.
Example: if input has shape [a,b,c] and dimensions = [2,0,1] the output has shape [c,a,b] |
INDArray |
prod(INDArray x,
boolean keepDims,
int... dimensions)
Product array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
prod(INDArray x,
int... dimensions)
Product array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
range(double from,
double to,
double step,
DataType dataType)
Create a new variable with a 1d array, where the values start at from and increment by step
up to (but not including) limit. For example, range(1.0, 3.0, 0.5) will return [1.0, 1.5, 2.0, 2.5] |
INDArray |
range(INDArray from,
INDArray to,
INDArray step,
DataType dataType)
Create a new variable with a 1d array, where the values start at from and increment by step
up to (but not including) limit. For example, range(1.0, 3.0, 0.5) will return [1.0, 1.5, 2.0, 2.5] |
INDArray |
rank(INDArray in)
Returns the rank (number of dimensions, i.e., length(shape)) of the specified INDArray as a 0D scalar variable
|
INDArray |
replaceWhere(INDArray update,
double value,
Condition condition)
Element-wise replace where condition:
out[i] = value if condition(update[i]) is satisfied, or out[i] = update[i] if condition(update[i]) is NOT satisfied |
INDArray |
replaceWhere(INDArray update,
INDArray from,
Condition condition)
Element-wise replace where condition:
out[i] = from[i] if condition(update[i]) is satisfied, or out[i] = update[i] if condition(update[i]) is NOT satisfied |
INDArray |
reshape(INDArray x,
INDArray shape)
Reshape the input variable to the specified (fixed) shape.
|
INDArray |
reshape(INDArray x,
long... shape)
Reshape the input variable to the specified (fixed) shape.
|
INDArray |
reverse(INDArray x,
int... dimensions)
Reverse the values of an array for the specified dimensions
If input is: [ 1, 2, 3] [ 4, 5, 6] then reverse(in, 0): [3, 2, 1] [6, 5, 4] reverse(in, 1): [4, 5, 6] [1, 2 3] |
INDArray |
reverseSequence(INDArray x,
INDArray seq_lengths)
Reverse sequence op: for each slice along dimension seqDimension, the first seqLength values are reversed
|
INDArray |
reverseSequence(INDArray x,
INDArray seq_lengths,
int seqDim,
int batchDim)
Reverse sequence op: for each slice along dimension seqDimension, the first seqLength values are reversed
|
INDArray |
scalarFloorMod(INDArray in,
double value)
Element-wise scalar floor modulus operation: out = floorMod(in, value).
i.e., returns the remainder after division by 'value' |
INDArray |
scalarMax(INDArray in,
double value)
Element-wise scalar maximum operation: out = max(in, value)
|
INDArray |
scalarMin(INDArray in,
double value)
Element-wise scalar minimum operation: out = min(in, value)
|
INDArray |
scalarSet(INDArray in,
double set)
Return a variable with equal shape to the input, but all elements set to value 'set'
|
INDArray |
scatterAdd(INDArray ref,
INDArray indices,
INDArray updates)
Scatter addition operation.
If indices is rank 0 (a scalar), then out[index, ...] = out[index, ...] + op(updates[...]) If indices is rank 1 (a vector), then for each position i, out[indices[i], ...] = out[indices[i], ...] + op(updates[i, ...]) If indices is rank 2+, then for each position (i,...,k), out[indices[i], ..., indices[k], ...] = out[indices[i], ..., indices[k], ...] + op(updates[i, ..., k, ...]) Note that if multiple indices refer to the same location, the contributions from each is handled correctly. |
INDArray |
scatterDiv(INDArray ref,
INDArray indices,
INDArray updates)
Scatter division operation.
If indices is rank 0 (a scalar), then out[index, ...] = out[index, ...] + op(updates[...]) If indices is rank 1 (a vector), then for each position i, out[indices[i], ...] = out[indices[i], ...] + op(updates[i, ...]) If indices is rank 2+, then for each position (i,...,k), out[indices[i], ..., indices[k], ...] = out[indices[i], ..., indices[k], ...] + op(updates[i, ..., k, ...]) Note that if multiple indices refer to the same location, the contributions from each is handled correctly. |
INDArray |
scatterMax(INDArray ref,
INDArray indices,
INDArray updates)
Scatter max operation.
If indices is rank 0 (a scalar), then out[index, ...] = out[index, ...] + op(updates[...]) If indices is rank 1 (a vector), then for each position i, out[indices[i], ...] = out[indices[i], ...] + op(updates[i, ...]) If indices is rank 2+, then for each position (i,...,k), out[indices[i], ..., indices[k], ...] = out[indices[i], ..., indices[k], ...] + op(updates[i, ..., k, ...]) Note that if multiple indices refer to the same location, the contributions from each is handled correctly. |
INDArray |
scatterMin(INDArray ref,
INDArray indices,
INDArray updates)
Scatter min operation.
If indices is rank 0 (a scalar), then out[index, ...] = out[index, ...] + op(updates[...]) If indices is rank 1 (a vector), then for each position i, out[indices[i], ...] = out[indices[i], ...] + op(updates[i, ...]) If indices is rank 2+, then for each position (i,...,k), out[indices[i], ..., indices[k], ...] = out[indices[i], ..., indices[k], ...] + op(updates[i, ..., k, ...]) Note that if multiple indices refer to the same location, the contributions from each is handled correctly. |
INDArray |
scatterMul(INDArray ref,
INDArray indices,
INDArray updates)
Scatter multiplication operation.
If indices is rank 0 (a scalar), then out[index, ...] = out[index, ...] + op(updates[...]) If indices is rank 1 (a vector), then for each position i, out[indices[i], ...] = out[indices[i], ...] + op(updates[i, ...]) If indices is rank 2+, then for each position (i,...,k), out[indices[i], ..., indices[k], ...] = out[indices[i], ..., indices[k], ...] + op(updates[i, ..., k, ...]) Note that if multiple indices refer to the same location, the contributions from each is handled correctly. |
INDArray |
scatterSub(INDArray ref,
INDArray indices,
INDArray updates)
Scatter subtraction operation.
If indices is rank 0 (a scalar), then out[index, ...] = out[index, ...] + op(updates[...]) If indices is rank 1 (a vector), then for each position i, out[indices[i], ...] = out[indices[i], ...] + op(updates[i, ...]) If indices is rank 2+, then for each position (i,...,k), out[indices[i], ..., indices[k], ...] = out[indices[i], ..., indices[k], ...] + op(updates[i, ..., k, ...]) Note that if multiple indices refer to the same location, the contributions from each is handled correctly. |
INDArray |
scatterUpdate(INDArray ref,
INDArray indices,
INDArray updates)
Scatter update operation.
If indices is rank 0 (a scalar), then out[index, ...] = out[index, ...] + op(updates[...]) If indices is rank 1 (a vector), then for each position i, out[indices[i], ...] = out[indices[i], ...] + op(updates[i, ...]) If indices is rank 2+, then for each position (i,...,k), out[indices[i], ..., indices[k], ...] = out[indices[i], ..., indices[k], ...] + op(updates[i, ..., k, ...]) Note that if multiple indices refer to the same location, the contributions from each is handled correctly. |
INDArray |
segmentMax(INDArray data,
INDArray segmentIds)
Segment max operation.
If data = [3, 6, 1, 4, 9, 2, 8] segmentIds = [0, 0, 1, 1, 1, 2, 2] then output = [6, 9, 8] = [op(3,6), op(1,4,9), op(2,8)] Note that the segment IDs must be sorted from smallest to largest segment. See {unsortedSegment (String, SDVariable, SDVariable, int) ops for the same op without this sorted requirement |
INDArray |
segmentMean(INDArray data,
INDArray segmentIds)
Segment mean operation.
If data = [3, 6, 1, 4, 9, 2, 8] segmentIds = [0, 0, 1, 1, 1, 2, 2] then output = [6, 9, 8] = [op(3,6), op(1,4,9), op(2,8)] Note that the segment IDs must be sorted from smallest to largest segment. See {unsortedSegment (String, SDVariable, SDVariable, int) ops for the same op without this sorted requirement |
INDArray |
segmentMin(INDArray data,
INDArray segmentIds)
Segment min operation.
If data = [3, 6, 1, 4, 9, 2, 8] segmentIds = [0, 0, 1, 1, 1, 2, 2] then output = [6, 9, 8] = [op(3,6), op(1,4,9), op(2,8)] Note that the segment IDs must be sorted from smallest to largest segment. See {unsortedSegment (String, SDVariable, SDVariable, int) ops for the same op without this sorted requirement |
INDArray |
segmentProd(INDArray data,
INDArray segmentIds)
Segment product operation.
If data = [3, 6, 1, 4, 9, 2, 8] segmentIds = [0, 0, 1, 1, 1, 2, 2] then output = [6, 9, 8] = [op(3,6), op(1,4,9), op(2,8)] Note that the segment IDs must be sorted from smallest to largest segment. See {unsortedSegment (String, SDVariable, SDVariable, int) ops for the same op without this sorted requirement |
INDArray |
segmentSum(INDArray data,
INDArray segmentIds)
Segment sum operation.
If data = [3, 6, 1, 4, 9, 2, 8] segmentIds = [0, 0, 1, 1, 1, 2, 2] then output = [6, 9, 8] = [op(3,6), op(1,4,9), op(2,8)] Note that the segment IDs must be sorted from smallest to largest segment. See {unsortedSegment (String, SDVariable, SDVariable, int) ops for the same op without this sorted requirement |
INDArray |
sequenceMask(INDArray lengths,
DataType dataType)
see sequenceMask(String, SDVariable, SDVariable, DataType)
|
INDArray |
sequenceMask(INDArray lengths,
INDArray maxLen,
DataType dataType)
Generate a sequence mask (with values 0 or 1) based on the specified lengths
Specifically, out[i, ..., k, j] = (j < lengths[i, ..., k] ? 1.0 : 0.0) |
INDArray |
sequenceMask(INDArray lengths,
int maxLen,
DataType dataType)
Generate a sequence mask (with values 0 or 1) based on the specified lengths
Specifically, out[i, ..., k, j] = (j < lengths[i, ..., k] ? 1.0 : 0.0) |
INDArray |
shape(INDArray input)
Returns the shape of the specified INDArray as a 1D INDArray
|
INDArray |
size(INDArray in)
Returns the size (number of elements, i.e., prod(shape)) of the specified INDArray as a 0D scalar variable
|
INDArray |
sizeAt(INDArray in,
int dimension)
Returns a rank 0 (scalar) variable for the size of the specified dimension.
For example, if X has shape [10,20,30] then sizeAt(X,1)=20. |
INDArray |
slice(INDArray input,
INDArray begin,
INDArray size)
Get a subset of the specified input, by specifying the first element and the size of the array.
For example, if input is: [a, b, c] [d, e, f] then slice(input, begin=[0,1], size=[2,1] will return: [b] [e] Note that for each dimension i, begin[i] + size[i] <= input.size(i) |
INDArray |
slice(INDArray input,
int[] begin,
int... size)
Get a subset of the specified input, by specifying the first element and the size of the array.
For example, if input is: [a, b, c] [d, e, f] then slice(input, begin=[0,1], size=[2,1] will return: [b] [e] Note that for each dimension i, begin[i] + size[i] <= input.size(i) |
INDArray |
squaredNorm(INDArray x,
boolean keepDims,
int... dimensions)
Squared L2 norm: see norm2(String, SDVariable, boolean, int...)
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
squaredNorm(INDArray x,
int... dimensions)
Squared L2 norm: see norm2(String, SDVariable, boolean, int...)
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
squeeze(INDArray x,
int axis)
Remove a single dimension of size 1.
For example, if input has shape [a,b,1,c] then squeeze(input, 2) returns an array of shape [a,b,c] |
INDArray |
stack(int axis,
INDArray... values)
Stack a set of N INDArray of rank X into one rank X+1 variable.
If inputs have shape [a,b,c] then output has shape: axis = 0: [N,a,b,c] axis = 1: [a,N,b,c] axis = 2: [a,b,N,c] axis = 3: [a,b,c,N] see unstack(String[], SDVariable, int, int) |
INDArray |
standardDeviation(INDArray x,
boolean biasCorrected,
boolean keepDims,
int... dimensions)
Stardard deviation array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
standardDeviation(INDArray x,
boolean biasCorrected,
int... dimensions)
Stardard deviation array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
stridedSlice(INDArray in,
long[] begin,
long[] end,
long... strides)
Get a subset of the specified input, by specifying the first element, last element, and the strides.
For example, if input is: [a, b, c] [d, e, f] [g, h, i] then stridedSlice(input, begin=[0,1], end=[2,2], strides=[2,1], all masks = 0) will return: [b, c] [h, i] |
INDArray |
stridedSlice(INDArray in,
long[] begin,
long[] end,
long[] strides,
int beginMask,
int endMask,
int ellipsisMask,
int newAxisMask,
int shrinkAxisMask)
Get a subset of the specified input, by specifying the first element, last element, and the strides.
For example, if input is: [a, b, c] [d, e, f] [g, h, i] then stridedSlice(input, begin=[0,1], end=[2,2], strides=[2,1], all masks = 0) will return: [b, c] [h, i] |
INDArray |
sum(INDArray x,
boolean keepDims,
int... dimensions)
Sum array reduction operation, optionally along specified dimensions.
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
sum(INDArray x,
int... dimensions)
Sum array reduction operation, optionally along specified dimensions.
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray[] |
switchOp(INDArray x,
INDArray predicate)
Switch operation
Predictate - if false, values are output to left (first) branch/output; if true, to right (second) branch/output |
INDArray |
tensorMmul(INDArray x,
INDArray y,
int[] dimensionsX,
int... dimensionsY)
//TODO: Ops must be documented.
|
INDArray |
tensorMmul(INDArray x,
INDArray y,
int[] dimensionsX,
int[] dimensionsY,
boolean transposeX,
boolean transposeY,
boolean transposeZ)
//TODO: Ops must be documented.
|
INDArray |
tile(INDArray x,
INDArray repeat)
Repeat (tile) the input tensor the specified number of times.
For example, if input is [1, 2] [3, 4] and repeat is [2, 3] then output is [1, 2, 1, 2, 1, 2] [3, 4, 3, 4, 3, 4] [1, 2, 1, 2, 1, 2] [3, 4, 3, 4, 3, 4] |
INDArray |
tile(INDArray x,
int... repeat)
see tile(String, SDVariable, int...)
|
INDArray |
transpose(INDArray x)
Matrix transpose operation: If input has shape [a,b] output has shape [b,a]
|
INDArray |
unsortedSegmentMax(INDArray data,
INDArray segmentIds,
int numSegments)
Unsorted segment max operation.
|
INDArray |
unsortedSegmentMean(INDArray data,
INDArray segmentIds,
int numSegments)
Unsorted segment mean operation.
|
INDArray |
unsortedSegmentMin(INDArray data,
INDArray segmentIds,
int numSegments)
Unsorted segment min operation.
|
INDArray |
unsortedSegmentProd(INDArray data,
INDArray segmentIds,
int numSegments)
Unsorted segment product operation.
|
INDArray |
unsortedSegmentSqrtN(INDArray data,
INDArray segmentIds,
int numSegments)
Unsorted segment sqrtN operation.
|
INDArray |
unsortedSegmentSum(INDArray data,
INDArray segmentIds,
int numSegments)
Unsorted segment sum operation.
|
INDArray[] |
unstack(INDArray value,
int axis,
int num)
Unstack a variable of rank X into N rank X-1 variables by taking slices along the specified axis.
If input has shape [a,b,c] then output has shape: axis = 0: [b,c] axis = 1: [a,c] axis = 2: [a,b] |
INDArray |
variance(INDArray x,
boolean biasCorrected,
boolean keepDims,
int... dimensions)
Variance array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
variance(INDArray x,
boolean biasCorrected,
int... dimensions)
Variance array reduction operation, optionally along specified dimensions
Note that if keepDims = true, the output variable has the same rank as the input variable, with the reduced dimensions having size 1. |
INDArray |
zerosLike(INDArray input)
Return a variable of all 0s, with the same shape as the input variable.
|
public INDArray all(INDArray x, int... dimensions)
x
- Input variable (NDARRAY type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray any(INDArray x, int... dimensions)
x
- Input variable (NDARRAY type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray argmax(INDArray in, boolean keepDims, int... dimensions)
in
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray argmax(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray argmin(INDArray in, boolean keepDims, int... dimensions)
in
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray argmin(INDArray in, int... dimensions)
in
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray[] batchMmul(INDArray[] inputsA, INDArray[] inputsB, boolean transposeA, boolean transposeB)
inputsA
- First array of input matrices, all of shape (M, N) or (N, M) (NUMERIC type)inputsB
- Second array of input matrices, all of shape (N, K) or (K, N) (NUMERIC type)transposeA
- Whether to transpose A arrays or nottransposeB
- Whether to transpose B arrays or notpublic INDArray[] batchMmul(INDArray[] inputsA, INDArray... inputsB)
inputsA
- First array of input matrices, all of shape (M, N) or (N, M) (NUMERIC type)inputsB
- Second array of input matrices, all of shape (N, K) or (K, N) (NUMERIC type)public INDArray castTo(INDArray arg, DataType datatype)
arg
- Input variable to cast (NDARRAY type)datatype
- Datatype to cast topublic INDArray concat(int dimension, INDArray... inputs)
inputs
- Input variables (NUMERIC type)dimension
- Dimension to concatenate onpublic INDArray cumprod(INDArray in, boolean exclusive, boolean reverse, int... axis)
in
- Input variable (NUMERIC type)exclusive
- If true: exclude the first valuereverse
- If true: reverse the direction of the accumulationaxis
- Scalar axis argument for dimension to perform cumululative sum operations along (Size: AtLeast(min=1))public INDArray cumprod(INDArray in, int... axis)
in
- Input variable (NUMERIC type)axis
- Scalar axis argument for dimension to perform cumululative sum operations along (Size: AtLeast(min=1))public INDArray cumsum(INDArray in, boolean exclusive, boolean reverse, int... axis)
in
- Input variable (NUMERIC type)exclusive
- If true: exclude the first valuereverse
- If true: reverse the direction of the accumulationaxis
- Scalar axis argument for dimension to perform cumululative sum operations along (Size: AtLeast(min=1))public INDArray cumsum(INDArray in, int... axis)
in
- Input variable (NUMERIC type)axis
- Scalar axis argument for dimension to perform cumululative sum operations along (Size: AtLeast(min=1))public INDArray dot(INDArray x, INDArray y, int... dimensions)
x
- first input (NUMERIC type)y
- second input (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray[] dynamicPartition(INDArray x, INDArray partitions, int numPartitions)
input = [1,2,3,4,5]
numPartitions = 2
partitions = [1,0,0,1,0]
out[0] = [2,3,5]
out[1] = [1,4] }
x
- Input variable (NUMERIC type)partitions
- 1D input with values 0 to numPartitions-1 (INT type)numPartitions
- Number of partitions, >= 1public INDArray dynamicStitch(INDArray[] indices, INDArray... x)
indices
- Indices to use when merging. Must be >= 1, same length as input variables (INT type)x
- Input variables. (NUMERIC type)public INDArray eq(INDArray x, double y)
x
- Input array (NUMERIC type)y
- Double value argument to use in operationpublic INDArray eq(INDArray x, INDArray y)
x
- Input 1 (NUMERIC type)y
- Input 2 (NUMERIC type)public INDArray expandDims(INDArray x, int axis)
x
- Input variable (NDARRAY type)axis
- Axis to expandpublic INDArray fill(INDArray shape, DataType dataType, double value)
shape
- Shape: must be a 1D array/variable (INT type)dataType
- Datatype of the output arrayvalue
- Value to set all elements topublic INDArray gather(INDArray df, int[] indices, int axis)
df
- Input variable (NUMERIC type)indices
- Indices to get (Size: AtLeast(min=1))axis
- Axis that the indices refer topublic INDArray gather(INDArray df, INDArray indices, int axis)
df
- Input variable (NUMERIC type)indices
- Indices to get slices for. Rank 0 or 1 input (INT type)axis
- Axis that the indices refer topublic INDArray gatherNd(INDArray df, INDArray indices)
df
- (NUMERIC type)indices
- (NUMERIC type)public INDArray gt(INDArray x, double y)
x
- Input array (NUMERIC type)y
- Double value argument to use in operationpublic INDArray gt(INDArray x, INDArray y)
x
- Input 1 (NUMERIC type)y
- Input 2 (NUMERIC type)public INDArray gte(INDArray x, double y)
x
- Input array (NUMERIC type)y
- Double value argument to use in operationpublic INDArray gte(INDArray x, INDArray y)
x
- Input 1 (NUMERIC type)y
- Input 2 (NUMERIC type)public INDArray identity(INDArray input)
input
- Input variable (NUMERIC type)public INDArray invertPermutation(INDArray input)
input
- 1D indices for permutation (INT type)public INDArray isNumericTensor(INDArray x)
x
- Input variable (NUMERIC type)public INDArray linspace(DataType dataType, double start, double stop, long number)
dataType
- Data type of the output arraystart
- Start valuestop
- Stop valuenumber
- Number of values to generatepublic INDArray linspace(INDArray start, INDArray stop, INDArray number, DataType dataType)
start
- Start value (NUMERIC type)stop
- Stop value (NUMERIC type)number
- Number of values to generate (LONG type)dataType
- Data type of the output arraypublic INDArray lt(INDArray x, double y)
x
- Input array (NUMERIC type)y
- Double value argument to use in operationpublic INDArray lt(INDArray x, INDArray y)
x
- Input 1 (NUMERIC type)y
- Input 2 (NUMERIC type)public INDArray lte(INDArray x, double y)
x
- Input array (NUMERIC type)y
- Double value argument to use in operationpublic INDArray lte(INDArray x, INDArray y)
x
- Input 1 (NUMERIC type)y
- Input 2 (NUMERIC type)public INDArray matchCondition(INDArray in, Condition condition)
in
- Input (NUMERIC type)condition
- Conditionpublic INDArray matchConditionCount(INDArray in, Condition condition)
in
- Input (NUMERIC type)condition
- Conditionpublic INDArray matchConditionCount(INDArray in, Condition condition, boolean keepDim, int... dimensions)
in
- Input variable (NUMERIC type)condition
- ConditionkeepDim
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray matchConditionCount(INDArray in, Condition condition, int... dimensions)
in
- Input variable (NUMERIC type)condition
- Conditiondimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray max(INDArray x, boolean keepDims, int... dimensions)
x
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray max(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray max(INDArray first, INDArray second)
first
- First input array (NUMERIC type)second
- Second input array (NUMERIC type)public INDArray mean(INDArray x, boolean keepDims, int... dimensions)
x
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray mean(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray merge(INDArray x, INDArray y)
x
- Input variable (NUMERIC type)y
- Input variable (NUMERIC type)public INDArray min(INDArray x, boolean keepDims, int... dimensions)
x
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray min(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray min(INDArray first, INDArray second)
first
- First input array (NUMERIC type)second
- Second input array (NUMERIC type)public INDArray mmul(INDArray x, INDArray y, boolean transposeX, boolean transposeY, boolean transposeZ)
x
- First input variable (NUMERIC type)y
- Second input variable (NUMERIC type)transposeX
- Transpose x (first argument)transposeY
- Transpose y (second argument)transposeZ
- Transpose result arraypublic INDArray mmul(INDArray x, INDArray y)
x
- First input variable (NUMERIC type)y
- Second input variable (NUMERIC type)public INDArray neq(INDArray x, double y)
x
- Input array (NUMERIC type)y
- Double value argument to use in operationpublic INDArray neq(INDArray x, INDArray y)
x
- Input 1 (NUMERIC type)y
- Input 2 (NUMERIC type)public INDArray norm1(INDArray x, boolean keepDims, int... dimensions)
x
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- dimensions to reduce over (Size: AtLeast(min=0))public INDArray norm1(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- dimensions to reduce over (Size: AtLeast(min=0))public INDArray norm2(INDArray x, boolean keepDims, int... dimensions)
x
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- dimensions dimensions to reduce over (Size: AtLeast(min=0))public INDArray norm2(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- dimensions dimensions to reduce over (Size: AtLeast(min=0))public INDArray normmax(INDArray x, boolean keepDims, int... dimensions)
x
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- dimensions to reduce over (Size: AtLeast(min=0))public INDArray normmax(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- dimensions to reduce over (Size: AtLeast(min=0))public INDArray oneHot(INDArray indices, int depth, int axis, double on, double off, DataType dataType)
indices
- Indices - value 0 to depth-1 (NUMERIC type)depth
- Number of classesaxis
- on
- off
- dataType
- Output data typepublic INDArray oneHot(INDArray indices, int depth, int axis, double on, double off)
indices
- Indices - value 0 to depth-1 (NUMERIC type)depth
- Number of classesaxis
- on
- off
- public INDArray oneHot(INDArray indices, int depth)
indices
- Indices - value 0 to depth-1 (NUMERIC type)depth
- Number of classespublic INDArray onesLike(INDArray input)
input
- Input INDArray (NUMERIC type)public INDArray onesLike(INDArray input, DataType dataType)
input
- (NUMERIC type)dataType
- public INDArray permute(INDArray x, INDArray dimensions)
x
- Input variable (NUMERIC type)dimensions
- Permute dimensions (INT type)public INDArray permute(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- (Size: AtLeast(min=0))public INDArray prod(INDArray x, boolean keepDims, int... dimensions)
x
- Input variable (NUMERIC type)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray prod(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray range(double from, double to, double step, DataType dataType)
from
- Initial/smallest valueto
- Largest value (exclusive)step
- Step sizedataType
- public INDArray range(INDArray from, INDArray to, INDArray step, DataType dataType)
from
- Initial/smallest value (NUMERIC type)to
- Largest value (exclusive) (NUMERIC type)step
- Step size (NUMERIC type)dataType
- public INDArray rank(INDArray in)
in
- Input variable (NUMERIC type)public INDArray replaceWhere(INDArray update, INDArray from, Condition condition)
update
- Source array (NUMERIC type)from
- Replacement values array (used conditionally). Must be same shape as 'update' array (NUMERIC type)condition
- Condition to check on update array elementspublic INDArray replaceWhere(INDArray update, double value, Condition condition)
update
- Source array (NUMERIC type)value
- Value to set at the output, if the condition is satisfiedcondition
- Condition to check on update array elementspublic INDArray reshape(INDArray x, INDArray shape)
x
- Input variable (NUMERIC type)shape
- New shape for variable (NUMERIC type)public INDArray reshape(INDArray x, long... shape)
x
- Input variable (NUMERIC type)shape
- New shape for variable (Size: AtLeast(min=0))public INDArray reverse(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- Input variable (Size: AtLeast(min=0))public INDArray reverseSequence(INDArray x, INDArray seq_lengths, int seqDim, int batchDim)
x
- Input variable (NUMERIC type)seq_lengths
- Length of the sequences (INT type)seqDim
- Sequence dimensionbatchDim
- Batch dimensionpublic INDArray reverseSequence(INDArray x, INDArray seq_lengths)
x
- Input variable (NUMERIC type)seq_lengths
- Length of the sequences (INT type)public INDArray scalarFloorMod(INDArray in, double value)
in
- Input variable (NUMERIC type)value
- Scalar value to comparepublic INDArray scalarMax(INDArray in, double value)
in
- Input variable (NUMERIC type)value
- Scalar value to comparepublic INDArray scalarMin(INDArray in, double value)
in
- Input variable (NUMERIC type)value
- Scalar value to comparepublic INDArray scalarSet(INDArray in, double set)
in
- Input variable (NUMERIC type)set
- Value to setpublic INDArray scatterAdd(INDArray ref, INDArray indices, INDArray updates)
ref
- Initial/source variable (NUMERIC type)indices
- Indices array (NUMERIC type)updates
- Updates to add to the initial/source array (NUMERIC type)public INDArray scatterDiv(INDArray ref, INDArray indices, INDArray updates)
ref
- Initial/source variable (NUMERIC type)indices
- Indices array (NUMERIC type)updates
- Updates to add to the initial/source array (NUMERIC type)public INDArray scatterMax(INDArray ref, INDArray indices, INDArray updates)
ref
- Initial/source variable (NUMERIC type)indices
- Indices array (NUMERIC type)updates
- Updates to add to the initial/source array (NUMERIC type)public INDArray scatterMin(INDArray ref, INDArray indices, INDArray updates)
ref
- Initial/source variable (NUMERIC type)indices
- Indices array (NUMERIC type)updates
- Updates to add to the initial/source array (NUMERIC type)public INDArray scatterMul(INDArray ref, INDArray indices, INDArray updates)
ref
- Initial/source variable (NUMERIC type)indices
- Indices array (NUMERIC type)updates
- Updates to add to the initial/source array (NUMERIC type)public INDArray scatterSub(INDArray ref, INDArray indices, INDArray updates)
ref
- Initial/source variable (NUMERIC type)indices
- Indices array (NUMERIC type)updates
- Updates to add to the initial/source array (NUMERIC type)public INDArray scatterUpdate(INDArray ref, INDArray indices, INDArray updates)
ref
- Initial/source variable (NUMERIC type)indices
- Indices array (NUMERIC type)updates
- Updates to add to the initial/source array (NUMERIC type)public INDArray segmentMax(INDArray data, INDArray segmentIds)
data
- Data to perform segment max on (NDARRAY type)segmentIds
- Variable for the segment IDs (NUMERIC type)public INDArray segmentMean(INDArray data, INDArray segmentIds)
data
- Data to perform segment max on (NDARRAY type)segmentIds
- Variable for the segment IDs (NUMERIC type)public INDArray segmentMin(INDArray data, INDArray segmentIds)
data
- Data to perform segment max on (NDARRAY type)segmentIds
- Variable for the segment IDs (NUMERIC type)public INDArray segmentProd(INDArray data, INDArray segmentIds)
data
- Data to perform segment max on (NDARRAY type)segmentIds
- Variable for the segment IDs (NUMERIC type)public INDArray segmentSum(INDArray data, INDArray segmentIds)
data
- Data to perform segment max on (NDARRAY type)segmentIds
- Variable for the segment IDs (NUMERIC type)public INDArray sequenceMask(INDArray lengths, int maxLen, DataType dataType)
lengths
- Lengths of the sequences (NUMERIC type)maxLen
- Maximum sequence lengthdataType
- public INDArray sequenceMask(INDArray lengths, INDArray maxLen, DataType dataType)
lengths
- Lengths of the sequences (NUMERIC type)maxLen
- Maximum sequence length (INT type)dataType
- public INDArray sequenceMask(INDArray lengths, DataType dataType)
lengths
- (NUMERIC type)dataType
- public INDArray shape(INDArray input)
input
- Input variable (NUMERIC type)public INDArray size(INDArray in)
in
- Input variable (NUMERIC type)public INDArray sizeAt(INDArray in, int dimension)
in
- Input variable (NUMERIC type)dimension
- Dimension to get size ofpublic INDArray slice(INDArray input, int[] begin, int... size)
input
- input Variable to get subset of (NUMERIC type)begin
- Beginning index. Must be same length as rank of input array (Size: AtLeast(min=1))size
- Size of the output array. Must be same length as rank of input array (Size: AtLeast(min=1))public INDArray slice(INDArray input, INDArray begin, INDArray size)
input
- input Variable to get subset of (NUMERIC type)begin
- Beginning index. Must be same length as rank of input array (INT type)size
- Size of the output array. Must be same length as rank of input array (INT type)public INDArray squaredNorm(INDArray x, boolean keepDims, int... dimensions)
x
- (NUMERIC type)keepDims
- dimensions
- (Size: AtLeast(min=0))public INDArray squaredNorm(INDArray x, int... dimensions)
x
- (NUMERIC type)dimensions
- (Size: AtLeast(min=0))public INDArray squeeze(INDArray x, int axis)
x
- Input variable (NUMERIC type)axis
- Size 1 dimension to removepublic INDArray stack(int axis, INDArray... values)
values
- Input variables to stack. Must have the same shape for all inputs (NDARRAY type)axis
- Axis to stack onpublic INDArray standardDeviation(INDArray x, boolean biasCorrected, boolean keepDims, int... dimensions)
x
- Input variable (NUMERIC type)biasCorrected
- If true: divide by (N-1) (i.e., sample stdev). If false: divide by N (population stdev)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray standardDeviation(INDArray x, boolean biasCorrected, int... dimensions)
x
- Input variable (NUMERIC type)biasCorrected
- If true: divide by (N-1) (i.e., sample stdev). If false: divide by N (population stdev)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray stridedSlice(INDArray in, long[] begin, long[] end, long[] strides, int beginMask, int endMask, int ellipsisMask, int newAxisMask, int shrinkAxisMask)
in
- Variable to get subset of (NUMERIC type)begin
- Beginning index (Size: AtLeast(min=1))end
- End index (Size: AtLeast(min=1))strides
- Stride ("step size") for each dimension. For example, stride of 2 means take every second element. (Size: AtLeast(min=1))beginMask
- Bit mask: If the ith bit is set to 1, then the value in the begin long[] is ignored, and a value of 0 is used instead for the beginning index for that dimensionendMask
- Bit mask: If the ith bit is set to 1, then the value in the end long[] is ignored, and a value of size(i)-1 is used instead for the end index for that dimensionellipsisMask
- Bit mask: only one non-zero value is allowed here. If a non-zero value is set, then other dimensions are inserted as required at the specified positionnewAxisMask
- Bit mask: if the ith bit is set to 1, then the begin/end/stride values are ignored, and a size 1 dimension is inserted at this pointshrinkAxisMask
- Bit mask: if the ith bit is set to 1, then the begin/end/stride values are ignored, and a size 1 dimension is removed at this point. Note that begin/end/stride values must result in a size 1 output for these dimensionspublic INDArray stridedSlice(INDArray in, long[] begin, long[] end, long... strides)
in
- Variable to get subset of (NUMERIC type)begin
- Beginning index (Size: AtLeast(min=1))end
- End index (Size: AtLeast(min=1))strides
- Stride ("step size") for each dimension. For example, stride of 2 means take every second element. (Size: AtLeast(min=1))public INDArray sum(INDArray x, boolean keepDims, int... dimensions)
x
- 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=0))public INDArray sum(INDArray x, int... dimensions)
x
- Input variable (NUMERIC type)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray[] switchOp(INDArray x, INDArray predicate)
x
- Input variable (NDARRAY type)predicate
- Predictate - if false, values are output to left (first) branch/output; if true, to right (second) branch/output (BOOL type)public INDArray tensorMmul(INDArray x, INDArray y, int[] dimensionsX, int[] dimensionsY, boolean transposeX, boolean transposeY, boolean transposeZ)
x
- Input variable x (NUMERIC type)y
- Input variable y (NUMERIC type)dimensionsX
- dimensions for first input array (x) (Size: AtLeast(min=1))dimensionsY
- dimensions for second input array (y) (Size: AtLeast(min=1))transposeX
- Transpose x (first argument)transposeY
- Transpose y (second argument)transposeZ
- Transpose result arraypublic INDArray tensorMmul(INDArray x, INDArray y, int[] dimensionsX, int... dimensionsY)
x
- Input variable x (NUMERIC type)y
- Input variable y (NUMERIC type)dimensionsX
- dimensions for first input array (x) (Size: AtLeast(min=1))dimensionsY
- dimensions for second input array (y) (Size: AtLeast(min=1))public INDArray tile(INDArray x, INDArray repeat)
x
- Input variable (NDARRAY type)repeat
- Number of times to repeat in each axis. Must have length equal to the rank of the input array (INT type)public INDArray tile(INDArray x, int... repeat)
x
- (NDARRAY type)repeat
- (Size: AtLeast(min=1))public INDArray transpose(INDArray x)
x
- Input variable (NDARRAY type)public INDArray unsortedSegmentMax(INDArray data, INDArray segmentIds, int numSegments)
data
- Data (variable) to perform unsorted segment max on (NUMERIC type)segmentIds
- Variable for the segment IDs (NUMERIC type)numSegments
- Number of segmentspublic INDArray unsortedSegmentMean(INDArray data, INDArray segmentIds, int numSegments)
data
- Data (variable) to perform unsorted segment max on (NUMERIC type)segmentIds
- Variable for the segment IDs (NUMERIC type)numSegments
- Number of segmentspublic INDArray unsortedSegmentMin(INDArray data, INDArray segmentIds, int numSegments)
data
- Data (variable) to perform unsorted segment max on (NUMERIC type)segmentIds
- Variable for the segment IDs (NUMERIC type)numSegments
- Number of segmentspublic INDArray unsortedSegmentProd(INDArray data, INDArray segmentIds, int numSegments)
data
- Data (variable) to perform unsorted segment max on (NUMERIC type)segmentIds
- Variable for the segment IDs (NUMERIC type)numSegments
- Number of segmentspublic INDArray unsortedSegmentSqrtN(INDArray data, INDArray segmentIds, int numSegments)
data
- Data (variable) to perform unsorted segment max on (NUMERIC type)segmentIds
- Variable for the segment IDs (NUMERIC type)numSegments
- Number of segmentspublic INDArray unsortedSegmentSum(INDArray data, INDArray segmentIds, int numSegments)
data
- Data (variable) to perform unsorted segment max on (NUMERIC type)segmentIds
- Variable for the segment IDs (NUMERIC type)numSegments
- Number of segmentspublic INDArray[] unstack(INDArray value, int axis, int num)
value
- Input variable to unstack (NDARRAY type)axis
- Axis to unstack onnum
- Number of output variablespublic INDArray variance(INDArray x, boolean biasCorrected, boolean keepDims, int... dimensions)
x
- Input variable (NUMERIC type)biasCorrected
- If true: divide by (N-1) (i.e., sample variable). If false: divide by N (population variance)keepDims
- If true: keep the dimensions that are reduced on (as size 1). False: remove the reduction dimensionsdimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray variance(INDArray x, boolean biasCorrected, int... dimensions)
x
- Input variable (NUMERIC type)biasCorrected
- If true: divide by (N-1) (i.e., sample variable). If false: divide by N (population variance)dimensions
- Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))public INDArray zerosLike(INDArray input)
input
- Input (NUMERIC type)Copyright © 2020. All rights reserved.