public abstract class BaseNDArray extends Object implements INDArray, Iterable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
compressed |
protected DataBuffer |
data |
protected int[] |
javaShapeInformation |
protected DataBuffer |
shapeInformation |
| Constructor and Description |
|---|
BaseNDArray() |
BaseNDArray(DataBuffer buffer) |
BaseNDArray(DataBuffer floatBuffer,
char order) |
BaseNDArray(DataBuffer data,
int[] shape) |
BaseNDArray(DataBuffer buffer,
int[] shape,
char ordering) |
BaseNDArray(DataBuffer buffer,
int[] shape,
int[] strides) |
BaseNDArray(DataBuffer data,
int[] shape,
int[] stride,
long offset) |
BaseNDArray(DataBuffer buffer,
int[] shape,
int[] stride,
long offset,
char ordering) |
BaseNDArray(DataBuffer buffer,
int[] shape,
long offset) |
BaseNDArray(DataBuffer buffer,
int[] shape,
long offset,
char ordering)
Constructor for stride and offset
|
BaseNDArray(double[][] data)
Initialize the ndarray as a matrix
with the given data (indices preserved)
|
BaseNDArray(double[][] data,
char ordering) |
BaseNDArray(double[] data,
int[] shape,
char ordering) |
BaseNDArray(double[] data,
int[] shape,
int[] stride,
long offset) |
BaseNDArray(double[] data,
int[] shape,
int[] stride,
long offset,
char ordering) |
BaseNDArray(float[] data) |
BaseNDArray(float[][] data)
Initialize the ndarray
with the given data
|
BaseNDArray(float[][] data,
char ordering) |
BaseNDArray(float[] data,
char order) |
BaseNDArray(float[] data,
int[] shape)
Create this ndarray with the given data and shape and 0 offset
|
BaseNDArray(float[] data,
int[] shape,
char ordering)
Create this ndarray with the given data and shape and 0 offset
|
BaseNDArray(float[] data,
int[] shape,
int[] stride) |
BaseNDArray(float[] data,
int[] shape,
int[] stride,
char ordering) |
BaseNDArray(float[] data,
int[] shape,
int[] stride,
long offset) |
BaseNDArray(float[] data,
int[] shape,
int[] stride,
long offset,
char ordering) |
BaseNDArray(float[] data,
int[] shape,
long offset) |
BaseNDArray(float[] data,
int[] shape,
long offset,
char ordering) |
BaseNDArray(int[] shape)
Create an ndarray
with the given shape
|
BaseNDArray(int[] shape,
char ordering) |
BaseNDArray(int[] shape,
DataBuffer buffer)
Create with the specified shape and buffer
|
BaseNDArray(int[] shape,
int[] stride)
Create the ndarray with
the specified shape and stride and an offset of 0
|
BaseNDArray(int[] shape,
int[] stride,
char ordering)
Create the ndarray with
the specified shape and stride and an offset of 0
|
BaseNDArray(int[] data,
int[] shape,
int[] strides) |
BaseNDArray(int[] shape,
int[] stride,
long offset)
Construct an ndarray of the specified shape
with an empty data array
|
BaseNDArray(int[] shape,
int[] stride,
long offset,
char ordering)
Construct an ndarray of the specified shape
with an empty data array
|
BaseNDArray(int[] shape,
int[] stride,
long offset,
char ordering,
boolean initialize)
Construct an ndarray of the specified shape.
|
BaseNDArray(int[] shape,
long offset) |
BaseNDArray(int[] shape,
long offset,
char ordering) |
BaseNDArray(int newRows,
int newColumns)
Creates a new n times m DoubleMatrix.
|
BaseNDArray(int newRows,
int newColumns,
char ordering)
Creates a new n times m DoubleMatrix.
|
BaseNDArray(List<INDArray> slices,
int[] shape)
Create an ndarray from the specified slices.
|
BaseNDArray(List<INDArray> slices,
int[] shape,
char ordering)
Create an ndarray from the specified slices.
|
BaseNDArray(List<INDArray> slices,
int[] shape,
int[] stride)
Create an ndarray from the specified slices.
|
BaseNDArray(List<INDArray> slices,
int[] shape,
int[] stride,
char ordering)
Create an ndarray from the specified slices.
|
| Modifier and Type | Method and Description |
|---|---|
IComplexNDArray |
add(IComplexNumber n) |
IComplexNDArray |
add(IComplexNumber n,
IComplexNDArray result) |
INDArray |
add(INDArray other)
copy addition of two matrices
|
INDArray |
add(INDArray other,
INDArray result)
copy addition of two matrices
|
INDArray |
add(Number n)
Scalar addition (cloning)
|
INDArray |
add(Number n,
INDArray result) |
INDArray |
addColumnVector(INDArray columnVector)
In place addition of a column vector
|
IComplexNDArray |
addi(IComplexNumber n) |
IComplexNDArray |
addi(IComplexNumber n,
IComplexNDArray result) |
INDArray |
addi(INDArray other)
in place addition of two matrices
|
INDArray |
addi(INDArray other,
INDArray result)
in place addition of two matrices
|
INDArray |
addi(Number n)
In place scalar addition
|
INDArray |
addi(Number n,
INDArray result)
In place addition
|
INDArray |
addiColumnVector(INDArray columnVector)
In place addition of a column vector
|
INDArray |
addiRowVector(INDArray rowVector)
In place addition of a column vector
|
INDArray |
addRowVector(INDArray rowVector)
In place addition of a column vector
|
INDArray |
amax(int... dimension)
Returns the absolute overall max of this ndarray along given dimensions
|
Number |
amaxNumber()
Returns maximum (absolute) value in this INDArray
|
INDArray |
amean(int... dimension)
Returns the absolute overall mean of this ndarray
|
Number |
ameanNumber()
Returns the absolute overall mean of this ndarray
|
INDArray |
amin(int... dimension)
Returns minimum (absolute) value in this INDArray, along the specified dimensions
|
Number |
aminNumber()
Returns absolute min value in this INDArray
|
INDArray |
argMax(int... dimension)
This method returns index of highest value along specified dimension(s)
|
protected void |
assertSlice(INDArray put,
int slice) |
INDArray |
assign(INDArray arr)
Assign all of the elements in the given
ndarray to this ndarray
|
INDArray |
assign(Number value)
Set the value of the ndarray to the specified value
|
INDArray |
assignIf(INDArray arr,
Condition condition)
Assign all elements from given ndarray that are matching given condition,
ndarray to this ndarray
|
protected void |
autoProcessScalarCall() |
INDArray |
broadcast(INDArray result)
Broadcasts this ndarray to be the specified shape
|
INDArray |
broadcast(int... shape)
Broadcasts this ndarray to be the specified shape
|
protected void |
checkArrangeArray(int[] arr) |
void |
checkDimensions(INDArray other)
Validate dimensions are equal
|
void |
cleanup()
Deprecated.
|
int |
columns()
Number of columns (shape[1]), throws an exception when
called when not 2d
|
INDArray |
cond(Condition condition)
1 in the ndarray if the element matches
the condition 0 otherwise
|
INDArray |
condi(Condition condition)
In-place: 1 in the ndarray if the element matches the condition 0 otherwise
|
INDArray |
convertToDoubles() |
INDArray |
convertToFloats() |
protected static DataBuffer.TypeEx |
convertType(DataBuffer.Type type) |
protected INDArray |
create(DataBuffer buffer) |
protected INDArray |
create(DataBuffer data,
int[] shape,
int[] strides) |
protected INDArray |
create(DataBuffer data,
int[] newShape,
int[] newStrides,
long offset) |
protected INDArray |
create(DataBuffer data,
int[] newShape,
int[] newStrides,
long offset,
char ordering) |
protected INDArray |
create(DataBuffer data,
int[] shape,
long offset) |
protected INDArray |
create(int[] shape) |
protected INDArray |
create(int[] shape,
char ordering) |
protected INDArray |
create(int[] shape,
int[] strides,
long offset) |
protected INDArray |
create(int rows,
int length) |
protected INDArray |
createScalar(double d) |
protected INDArray |
createScalarForIndex(int i,
boolean applyOffset) |
INDArray |
cumsum(int dimension)
Cumulative sum along a dimension (in place)
|
INDArray |
cumsumi(int dimension)
Cumulative sum along a dimension
|
DataBuffer |
data()
Returns a linear double array representation of this ndarray
|
INDArray |
detach()
This metod detaches INDArray from Workspace, returning copy.
|
INDArray |
dimShuffle(Object[] rearrange,
int[] newOrder,
boolean[] broadCastable)
Dimshuffle: an extension of permute that adds the ability
to broadcast various dimensions.
|
double |
distance1(INDArray other)
Returns the (1-norm) distance.
|
double |
distance2(INDArray other)
Returns the (euclidean) distance.
|
IComplexNDArray |
div(IComplexNumber n) |
IComplexNDArray |
div(IComplexNumber n,
IComplexNDArray result) |
INDArray |
div(INDArray other)
in place (element wise) division of two matrices
|
INDArray |
div(INDArray other,
INDArray result)
copy (element wise) division of two matrices
|
INDArray |
div(Number n)
Division by a number
|
INDArray |
div(Number n,
INDArray result) |
INDArray |
divColumnVector(INDArray columnVector)
In place addition of a column vector
|
IComplexNDArray |
divi(IComplexNumber n) |
IComplexNDArray |
divi(IComplexNumber n,
IComplexNDArray result) |
INDArray |
divi(INDArray other)
in place (element wise) division of two matrices
|
INDArray |
divi(INDArray other,
INDArray result)
in place (element wise) division of two matrices
|
INDArray |
divi(Number n)
In place scalar division
|
INDArray |
divi(Number n,
INDArray result)
In place division of this ndarray
|
INDArray |
diviColumnVector(INDArray columnVector)
In place addition of a column vector
|
INDArray |
diviRowVector(INDArray rowVector)
In place addition of a column vector
|
INDArray |
divRowVector(INDArray rowVector)
In place addition of a column vector
|
protected INDArray |
doColumnWise(INDArray columnVector,
char operation)
Do a row wise op (a,s,m,d)
a : add
s : subtract
m : multiply
d : divide
h : reverse subtraction
t : reverse division
|
protected int[] |
doPermuteSwap(DataBuffer shape,
int[] rearrange) |
protected int[] |
doPermuteSwap(IntBuffer shape,
int[] rearrange) |
protected INDArray |
doRowWise(INDArray rowVector,
char operation)
Do a row wise op (a,s,m,d)
a : add
s : subtract
m : multiply
d : divide
h : reverse subtraction
t : reverse division
|
INDArray |
dup()
Returns a copy of this ndarray
|
INDArray |
dup(char order)
Returns a copy of this ndarray, where the returned ndarray has the specified order
|
Object |
element()
Returns a scalar (individual element)
of a scalar ndarray
|
int |
elementStride()
Element stride (one element to the next,
also called the defualt stride: 1 for normal
2 for complex)
|
int |
elementWiseStride()
Element wise stride
|
INDArray |
entropy(int... dimension)
Returns entropy along dimension
|
Number |
entropyNumber()
Returns entropy value for this INDArray
|
INDArray |
eps(INDArray other)
epsilon equals than comparison:
If the given number is less than the
comparison number the item is 0 otherwise 1
|
INDArray |
eps(Number other)
Returns an ndarray with 1 if the element is epsilon equals
|
INDArray |
epsi(INDArray other)
In place epsilon equals than comparison:
If the given number is less than the
comparison number the item is 0 otherwise 1
|
INDArray |
epsi(Number other)
Returns an ndarray with 1 if the element is epsilon equals
|
INDArray |
eq(INDArray other)
Returns the binary ndarray for "Equals" comparison.
|
INDArray |
eq(Number other)
Returns the binary ndarray for "Equals" comparison.
|
INDArray |
eqi(INDArray other)
Returns the binary ndarray for "Equals" comparison.
|
INDArray |
eqi(Number other)
Returns the binary ndarray for "Equals" comparison.
|
boolean |
equals(Object o)
Compare two matrices.
|
boolean |
equalsWithEps(Object o,
double eps)
This method allows you to compare INDArray against other INDArray, with variable eps
|
int[] |
flags() |
INDArray |
fmod(INDArray denominator)
remainder of division
|
INDArray |
fmod(INDArray denominator,
INDArray result)
remainder of division
|
INDArray |
fmod(Number denominator) |
INDArray |
fmod(Number denominator,
INDArray result) |
INDArray |
fmodi(INDArray denominator)
In place fmod
|
INDArray |
fmodi(Number denominator)
In place fmod
|
INDArray |
get(INDArray indices)
Get the elements from this ndarray based on the specified indices
|
INDArray |
get(INDArrayIndex... indexes)
Returns a subset of this array based on the specified
indexes
|
INDArray |
get(List<List<Integer>> indices)
Get the elements from this ndarray based on the specified indices
|
INDArray |
getColumn(int c)
Get the specified column
|
INDArray |
getColumns(int... cindices)
Get whole columns
from the passed indices.
|
double |
getDouble(int... indices)
Returns the elements at the the specified indices
|
double |
getDouble(int i)
Get the double value at the specified linear index in the array
|
double |
getDouble(int i,
int j)
Get the double value at the specified indices.
|
double |
getDoubleUnsafe(long offset)
Get a scalar
at the given linear offset
|
float |
getFloat(int... indices)
Returns the elements at the the specified indices
|
float |
getFloat(int i)
Return the item at the linear index i
|
float |
getFloat(int i,
int j)
Return the item at row i column j
Note that this is the same as calling getScalar(new int[]{i,j}
|
SparseFormat |
getFormat()
Return the sparse format (i.e COO, CSR, ...)
|
int |
getInt(int... indices)
Returns the elements at the the specified indices
|
int |
getLeadingOnes()
Get the number of leading ones in the array shape.
|
protected double |
getPercentile(Number quantile,
INDArray sorted) |
INDArray |
getRow(int r)
Get a copy of a row.
|
INDArray |
getRows(int[] rindices)
Get whole rows from the passed indices.
|
INDArray |
getScalar(int... indexes)
Fetch a particular number on a multi dimensional scale.
|
INDArray |
getScalar(int i)
Returns the element at the specified index
|
INDArray |
getScalar(int row,
int column)
Returns the element at the specified row/column
This will throw an exception if the
|
protected int[] |
getStrides(int[] shape,
char ordering) |
int |
getTrailingOnes()
Get the number of trailing ones in the array shape.
|
DataBuffer |
getVectorCoordinates()
Return a array of non-major pointers
i.e.
|
INDArray |
getWhere(INDArray comp,
Condition condition)
Boolean indexing:
Return the element if it fulfills the condition in
result array
|
INDArray |
getWhere(Number comp,
Condition condition)
Boolean indexing:
Return the element if it fulfills the condition in
result array
|
INDArray |
gt(INDArray other)
Returns the binary ndarray for "Greter" comparison.
|
INDArray |
gt(Number other)
Returns the binary ndarray for "Greater" comparison.
|
INDArray |
gte(Number other)
Returns binary ndarray for "Greter or equals" comparison.
|
INDArray |
gtei(Number other)
Returns the binary ndarray for "Greter or equals" comparison.
|
INDArray |
gti(INDArray other)
Returns the binary ndarray for "Greter" comparison.
|
INDArray |
gti(Number other)
Returns the binary ndarray for "Greter" comparison.
|
int[] |
hiddenDimensions() |
int |
index(int row,
int column)
Deprecated.
|
protected void |
init(int[] shape,
int[] stride) |
int |
innerMostStride()
Get the inner most stride
wrt the ordering of the array
|
protected static DataBuffer |
internalCreateBuffer(double[] data) |
protected static DataBuffer |
internalCreateBuffer(double[] data,
long offset) |
protected static DataBuffer |
internalCreateBuffer(float[] data) |
protected static DataBuffer |
internalCreateBuffer(float[] data,
long offset) |
protected static DataBuffer |
internalCreateBuffer(int[] data) |
protected static DataBuffer |
internalCreateBuffer(int[] data,
long offset) |
boolean |
isAttached()
This method returns True, if this INDArray instance is attached to some Workspace.
|
boolean |
isCleanedUp()
Deprecated.
|
boolean |
isColumnVector()
Checks whether the matrix is a column vector.
|
boolean |
isColumnVectorOrScalar()
Returns true if the number of columns is 1
|
boolean |
isCompressed()
Returns true if this array is compressed, and false otherwise
|
boolean |
isInScope()
This method checks, if given attached INDArray is still in scope of its parent Workspace
|
boolean |
isMatrix()
Returns true if this ndarray is 2d
or 3d with a singleton element
|
boolean |
isRowVector()
Checks whether the matrix is a row vector.
|
boolean |
isRowVectorOrScalar()
Returns true if the number of rows is 1
|
boolean |
isScalar()
Test whether a matrix is scalar.
|
boolean |
isSparse()
Returns true if this array is sparse
|
boolean |
isSquare()
Returns whether the matrix
has the same rows and columns
|
boolean |
isValid()
Deprecated.
|
boolean |
isVector()
Checks whether the matrix is a vector.
|
boolean |
isVectorOrScalar()
Returns true if this ndarray is a vector or scalar
|
boolean |
isView()
Returns true if this array is a view or not
|
boolean |
isWrapAround()
Deprecated.
|
Iterator<Object> |
iterator() |
INDArray |
javaTensorAlongDimension(int index,
int... dimension)
Get the vector along a particular dimension
|
int |
length()
Returns the total number of elements in the ndarray
|
long |
lengthLong()
Returns the total number of elements in the ndarray
|
INDArray |
leverage()
This method detaches INDArray from current Workspace, and attaches it to Workspace above, if any.
|
INDArray |
leverageOrDetach(String id)
This method detaches INDArray from current Workspace, and attaches it to Workspace with a given Id, if a workspace
with the given ID is open and active.
|
INDArray |
leverageTo(String id)
This method detaches INDArray from current Workspace, and attaches it to Workspace with a given Id
PLEASE NOTE: If this INDArray instance is NOT attached - it will be returned unmodified.
|
INDArray |
leverageTo(String id,
boolean enforceExistence)
This method detaches INDArray from current Workspace, and attaches it to Workspace with a given Id.
|
int |
linearIndex(int i)
Deprecated.
|
INDArray |
linearView()
Returns a linear view reference of shape
1,length(ndarray)
|
INDArray |
linearViewColumnOrder()
Deprecated.
|
INDArray |
logEntropy(int... dimension)
Returns log entropy along dimension
|
Number |
logEntropyNumber()
Returns log entropy value for this INDArray
|
INDArray |
lt(INDArray other)
Returns the binary ndarray for "Less" comparison.
|
INDArray |
lt(Number other)
Returns the binary ndarray for "Less" comparison.
|
INDArray |
lte(Number other)
Returns the binary ndarray for "Less or equals" comparison.
|
INDArray |
ltei(Number other)
Returns the binary ndarray for "Less or equals" comparison.
|
INDArray |
lti(INDArray other)
Returns the binary ndarray for "Less" comparison.
|
INDArray |
lti(Number other)
Returns the binary ndarray for "Less" comparison.
|
int |
majorStride()
Deprecated.
|
void |
markAsCompressed(boolean reallyCompressed)
This method marks INDArray instance as compressed
PLEASE NOTE: Do not use this method unless you 100% have to
|
INDArray |
match(INDArray comp,
Condition condition)
Return a mask on whether each element
matches the given condition
|
INDArray |
match(Number comp,
Condition condition)
Returns a mask
|
INDArray |
max(int... dimension)
Returns the overall max of this ndarray
|
IComplexNumber |
maxComplex() |
Number |
maxNumber()
Returns maximum value in this INDArray
|
INDArray |
mean(INDArray result,
int... dimension)
Returns the overall mean of this ndarray
|
INDArray |
mean(int... dimension)
Returns the overall mean of this ndarray
|
IComplexNumber |
meanComplex() |
Number |
meanNumber()
Returns the overall mean of this ndarray
|
INDArray |
median(int... dimension)
This method returns median along given dimension(s)
|
Number |
medianNumber()
This method returns median value for this INDArray
|
INDArray |
migrate()
This method pulls this INDArray into current Workspace.
|
INDArray |
migrate(boolean detachOnNoWs)
This method pulls this INDArray into current Workspace, or optionally detaches if no workspace is present.
That is: If current workspace is present/active, INDArray is migrated to it. If no current workspace is present/active, one of two things occur: 1. |
INDArray |
min(int... dimension)
Returns the overall min of this ndarray
|
IComplexNumber |
minComplex() |
Number |
minNumber()
Returns min value in this INDArray
|
INDArray |
mmul(INDArray other)
Perform a copy matrix multiplication
|
INDArray |
mmul(INDArray other,
INDArray result)
Perform an copy matrix multiplication
|
INDArray |
mmul(INDArray other,
INDArray result,
MMulTranspose mMulTranspose)
Perform a copy matrix multiplication
|
INDArray |
mmul(INDArray other,
MMulTranspose mMulTranspose)
Perform a copy matrix multiplication
|
INDArray |
mmuli(INDArray other)
Perform an copy matrix multiplication
|
INDArray |
mmuli(INDArray other,
INDArray result)
Perform an copy matrix multiplication
|
INDArray |
mmuli(INDArray other,
INDArray result,
MMulTranspose transpose)
Perform an in place matrix multiplication
|
INDArray |
mmuli(INDArray other,
MMulTranspose transpose)
Perform an copy matrix multiplication
|
IComplexNDArray |
mul(IComplexNumber n) |
IComplexNDArray |
mul(IComplexNumber n,
IComplexNDArray result) |
INDArray |
mul(INDArray other)
copy (element wise) multiplication of two matrices
|
INDArray |
mul(INDArray other,
INDArray result)
copy (element wise) multiplication of two matrices
|
INDArray |
mul(Number n)
Scalar multiplication (copy)
|
INDArray |
mul(Number n,
INDArray result) |
INDArray |
mulColumnVector(INDArray columnVector)
In place addition of a column vector
|
IComplexNDArray |
muli(IComplexNumber n) |
IComplexNDArray |
muli(IComplexNumber n,
IComplexNDArray result) |
INDArray |
muli(INDArray other)
in place (element wise) multiplication of two matrices
|
INDArray |
muli(INDArray other,
INDArray result)
in place (element wise) multiplication of two matrices
|
INDArray |
muli(Number n)
In place scalar multiplication
|
INDArray |
muli(Number n,
INDArray result)
In place multiplication of this ndarray
|
INDArray |
muliColumnVector(INDArray columnVector)
In place addition of a column vector
|
INDArray |
muliRowVector(INDArray rowVector)
In place addition of a column vector
|
INDArray |
mulRowVector(INDArray rowVector)
In place addition of a column vector
|
INDArray |
neg()
Negate each element.
|
INDArray |
negi()
Negate each element (in-place).
|
INDArray |
neq(INDArray other)
Returns the binary ndarray for "Not equals" comparison.
|
INDArray |
neq(Number other)
Returns the binary ndarray for "Not equals" comparison.
|
INDArray |
neqi(INDArray other)
Returns the binary ndarray for "Not equals" comparison.
|
INDArray |
neqi(Number other)
Returns the binary ndarray for "Not equals" comparison.
|
protected INDArray |
newShape(int[] newShape,
char ordering) |
int |
nnz()
Return the number of non-null element
|
INDArray |
norm1(int... dimension)
Returns the norm1 along the specified dimension
|
IComplexNumber |
norm1Complex()
Calculate and return norm1 (L1 norm, i.e., sum of absolute values; also known as Taxicab or Manhattan norm) for
the entire array
|
Number |
norm1Number()
Calculate and return norm1 (L1 norm, i.e., sum of absolute values; also known as Taxicab or Manhattan norm) for
the entire array
|
INDArray |
norm2(int... dimension)
Returns the norm2 along the specified dimension
|
IComplexNumber |
norm2Complex() |
Number |
norm2Number()
Return the norm2 (L2 norm, sqrt(sum(x_i^2), also known as Euclidean norm) for the entire array
|
INDArray |
normmax(int... dimension)
Returns the normmax along the specified dimension
|
IComplexNumber |
normmaxComplex() |
Number |
normmaxNumber()
Return the max norm (aka infinity norm, equal to the maximum absolute value) for the entire array
|
long |
offset()
Returns the start of where the ndarray is
for the underlying data
|
char |
ordering()
Return the ordering (fortran or c 'f' and 'c' respectively) of this ndarray
|
long |
originalOffset()
Returns the start of where the ndarray is for the original data buffer
|
INDArray |
percentile(Number quantile,
int... dimension)
This method returns median along given dimension(s)
|
Number |
percentileNumber(Number quantile)
This method returns percentile value for this INDArray
|
INDArray |
permute(int... rearrange)
See: http://www.mathworks.com/help/matlab/ref/permute.html
|
INDArray |
permutei(int... rearrange)
An in-place version of permute.
|
INDArray |
prod(int... dimension)
Returns the product along a given dimension
|
IComplexNumber |
prodComplex() |
Number |
prodNumber()
Calculate the product of all values in the array
|
INDArray |
put(INDArray indices,
INDArray element)
Put element in to the indices denoted by
the indices ndarray.
|
INDArray |
put(INDArrayIndex[] indices,
INDArray element)
Put the elements of the ndarray
in to the specified indices
|
INDArray |
put(INDArrayIndex[] indices,
Number element)
Put the elements of the ndarray
in to the specified indices
|
INDArray |
put(int[] indices,
INDArray element)
Inserts the element at the specified index
|
INDArray |
put(int i,
INDArray element)
Inserts the element at the specified index
|
INDArray |
put(int i,
int j,
INDArray element)
Inserts the element at the specified index
|
INDArray |
put(int i,
int j,
Number element)
Inserts the element at the specified index
|
INDArray |
put(List<List<Integer>> indices,
INDArray element)
Put element in to the indices denoted by
the indices ndarray.
|
INDArray |
putColumn(int column,
INDArray toPut)
Insert a column in to this array
Will throw an exception if this
ndarray is not a matrix
|
INDArray |
putiColumnVector(INDArray columnVector)
In place assignment of a column vector
|
INDArray |
putiRowVector(INDArray rowVector)
in place assignment of row vector, to each row of this array
|
INDArray |
putRow(int row,
INDArray toPut)
Insert a row in to this array
Will throw an exception if this
ndarray is not a matrix
|
INDArray |
putScalar(int[] indexes,
double value)
Insert the item at the specified indices
|
INDArray |
putScalar(int[] indexes,
float value)
Put the specified float value at the specified indices in this array
|
INDArray |
putScalar(int[] indexes,
int value)
Put the specified integer value at the specified indices in this array
|
INDArray |
putScalar(int i,
double value)
Insert the number linearly in to the ndarray
|
INDArray |
putScalar(int i,
float value)
Insert a scalar float at the specified index
|
INDArray |
putScalar(int i,
int value)
Insert a scalar int at the specified index
|
INDArray |
putScalar(int row,
int col,
double value)
Insert the value at the specified indices, in a 2d (rank 2) NDArray
Equivalent to INDArray.putScalar(int[], double) but avoids int[] creation |
INDArray |
putScalar(int dim0,
int dim1,
int dim2,
double value)
Insert the value at the specified indices, in a 3d (rank 3) NDArray
Equivalent to INDArray.putScalar(int[], double) but avoids int[] creation |
INDArray |
putScalar(int dim0,
int dim1,
int dim2,
int dim3,
double value)
Insert the value at the specified indices, in a 4d (rank 4) NDArray
Equivalent to INDArray.putScalar(int[], double) but avoids int[] creation |
INDArray |
putScalarUnsafe(long offset,
double value)
Insert a scalar
at the given linear offset
|
INDArray |
putSlice(int slice,
INDArray put)
Assigns the given matrix (put) to the specified slice
|
INDArray |
putWhere(INDArray comp,
INDArray put,
Condition condition)
Assign the element according
to the comparison array
|
INDArray |
putWhere(Number comp,
INDArray put,
Condition condition)
Assign the element according
to the comparison array
|
INDArray |
putWhere(Number comp,
Number put,
Condition condition)
Assign the element according
to the comparison array
|
INDArray |
putWhereWithMask(INDArray mask,
INDArray put)
Use a pre computed mask
for assigning arrays
|
INDArray |
putWhereWithMask(INDArray mask,
Number put)
Use a pre computed mask
for assigning arrays
|
int |
rank()
Returns the rank of the ndarray (the number of dimensions).
|
INDArray |
ravel()
Flattens the array for linear indexing
|
INDArray |
ravel(char ordering)
Flattens the array for linear indexing
|
IComplexNDArray |
rdiv(IComplexNumber n) |
IComplexNDArray |
rdiv(IComplexNumber n,
IComplexNDArray result) |
INDArray |
rdiv(INDArray other)
Reverse division
|
INDArray |
rdiv(INDArray other,
INDArray result)
Reverse division
|
INDArray |
rdiv(Number n)
Reverse division with a scalar - i.e., (n / thisArrayValues)
|
INDArray |
rdiv(Number n,
INDArray result)
Reverse division (number / ndarray)
|
INDArray |
rdivColumnVector(INDArray columnVector)
Reverse division of a column vector (copy)
|
IComplexNDArray |
rdivi(IComplexNumber n) |
IComplexNDArray |
rdivi(IComplexNumber n,
IComplexNDArray result) |
INDArray |
rdivi(INDArray other)
Reverse divsion (in place)
|
INDArray |
rdivi(INDArray other,
INDArray result)
Reverse division (in-place)
|
INDArray |
rdivi(Number n)
In place reverse division - i.e., (n / thisArrayValues)
|
INDArray |
rdivi(Number n,
INDArray result)
Reverse in place division
|
INDArray |
rdiviColumnVector(INDArray columnVector)
In place reverse divison of a column vector
|
INDArray |
rdiviRowVector(INDArray rowVector)
In place reverse division of a column vector
|
INDArray |
rdivRowVector(INDArray rowVector)
Reverse division of a column vector (copy)
|
protected void |
read(ObjectInputStream s) |
INDArray |
remainder(INDArray denominator)
Remainder operator
|
INDArray |
remainder(INDArray denominator,
INDArray result)
Remainder operator
|
INDArray |
remainder(Number denominator)
The scalar denominator
|
INDArray |
remainder(Number denominator,
INDArray result) |
INDArray |
remainderi(INDArray denominator)
In place remainder
|
INDArray |
remainderi(Number denominator)
In place remainder
|
INDArray |
repeat(int dimension,
int... repeats)
Repeat elements along a specified dimension.
|
INDArray |
replaceWhere(INDArray arr,
Condition condition)
Replaces all elements in this ndarray that are matching give condition, with corresponding elements from given array
|
INDArray |
repmat(int[] shape)
Replicate and tile array to fill out to the given shape
See:
https://github.com/numpy/numpy/blob/master/numpy/matlib.py#L310-L358
|
void |
resetLinearView()
Resets the linear view
|
INDArray |
reshape(char order,
int... newShape)
Reshapes the ndarray (can't change the length of the ndarray).
|
INDArray |
reshape(char order,
int rows,
int columns)
Reshapes the ndarray (can't change the length of the ndarray).
|
INDArray |
reshape(int... shape)
Reshape the ndarray in to the specified dimensions,
possible errors being thrown for invalid shapes
Note here that one dimension can be -1.
|
INDArray |
reshape(int newRows,
int newColumns)
Reshape the matrix.
|
int |
rows()
Returns the number of rows
in the array (only 2d) throws an exception when
called when not 2d
|
IComplexNDArray |
rsub(IComplexNumber n) |
IComplexNDArray |
rsub(IComplexNumber n,
IComplexNDArray result) |
INDArray |
rsub(INDArray other)
Element-wise reverse subtraction (copy op).
|
INDArray |
rsub(INDArray other,
INDArray result)
Reverse subtraction
|
INDArray |
rsub(Number n)
Reverse subtraction with duplicates - i.e., (n - thisArrayValues)
|
INDArray |
rsub(Number n,
INDArray result)
Reverse subtraction
|
INDArray |
rsubColumnVector(INDArray columnVector)
Reverse subtraction of a column vector (copy)
|
IComplexNDArray |
rsubi(IComplexNumber n) |
IComplexNDArray |
rsubi(IComplexNumber n,
IComplexNDArray result) |
INDArray |
rsubi(INDArray other)
Element-wise reverse subtraction (in the place op) - i.e., other - this
|
INDArray |
rsubi(INDArray other,
INDArray result)
Reverse subtraction (in-place)
|
INDArray |
rsubi(Number n)
Reverse subtraction in place - i.e., (n - thisArrayValues)
|
INDArray |
rsubi(Number n,
INDArray result)
Reverse in place subtraction
|
INDArray |
rsubiColumnVector(INDArray columnVector)
In place reverse subtraction of a column vector
|
INDArray |
rsubiRowVector(INDArray rowVector)
In place reverse subtraction of a row vector
|
INDArray |
rsubRowVector(INDArray rowVector)
Reverse subtraction of a row vector (copy)
|
Number |
scan(Condition condition)
This method takes boolean condition, and returns number of elements matching this condition
|
int |
secondaryStride()
Deprecated.
|
void |
setData(DataBuffer data) |
void |
setOrder(char order)
Set the ordering
|
void |
setShape(int... shape)
Shape setter
|
void |
setShapeAndStride(int[] shape,
int[] stride)
Shape and stride setter
|
void |
setStride(int[] stride)
stride setter
|
void |
setWrapAround(boolean wrapAround)
Deprecated.
|
INDArray |
shannonEntropy(int... dimension)
Returns non-normalized Shannon entropy along dimension
|
Number |
shannonEntropyNumber()
Returns non-normalized Shannon entropy value for this INDArray
|
int[] |
shape()
Returns the shape(dimensions) of this array
|
IntBuffer |
shapeInfo()
Shape info
|
DataBuffer |
shapeInfoDataBuffer()
Shape info
|
String |
shapeInfoToString()
Returns the shape information debugging
information
|
protected DataBuffer |
shapeOf() |
int |
size(int dimension)
Returns the size of this array
along a particular dimension
|
INDArray |
slice(int slice)
Returns the specified slice of this matrix.
|
INDArray |
slice(int slice,
int dimension)
Returns the slice of this from the specified dimension
|
int |
slices()
Number of slices: aka shape[0]
|
void |
sliceVectors(List<INDArray> list)
Flattens the array for linear indexing
|
DataBuffer |
sparseInfoDataBuffer()
Sparse info
|
int[] |
sparseOffsets() |
double |
squaredDistance(INDArray other)
Returns the square of the Euclidean distance.
|
INDArray |
std(boolean biasCorrected,
int... dimension)
Standard deviation of an ndarray along a dimension
|
INDArray |
std(int... dimension)
Standard deviation of an ndarray along a dimension
|
IComplexNumber |
stdComplex() |
Number |
stdNumber()
Calculate the standard deviation for the entire array
|
Number |
stdNumber(boolean biasCorrected)
Calculate the standard deviation for the entire array, specifying whether it is bias corrected or not
|
int[] |
stride()
Returns the stride(indices along the linear index for which each slice is accessed) of this array
|
int |
stride(int dimension)
Calculate the stride along a particular dimension
|
protected DataBuffer |
strideOf() |
IComplexNDArray |
sub(IComplexNumber n) |
IComplexNDArray |
sub(IComplexNumber n,
IComplexNDArray result) |
INDArray |
sub(INDArray other)
copy subtraction of two matrices
|
INDArray |
sub(INDArray other,
INDArray result)
copy subtraction of two matrices
|
INDArray |
sub(Number n)
Scalar subtraction (copied)
|
INDArray |
sub(Number n,
INDArray result) |
INDArray |
subArray(long[] offsets,
int[] shape,
int[] stride) |
INDArray |
subArray(ShapeOffsetResolution resolution)
Sub array based on the
pre calculated shape,strides, offsets
|
INDArray |
subColumnVector(INDArray columnVector)
In place addition of a column vector
|
IComplexNDArray |
subi(IComplexNumber n) |
IComplexNDArray |
subi(IComplexNumber n,
IComplexNDArray result) |
INDArray |
subi(INDArray other)
in place subtraction of two matrices
|
INDArray |
subi(INDArray other,
INDArray result)
in place subtraction of two matrices
|
INDArray |
subi(Number n)
In place scalar subtraction
|
INDArray |
subi(Number n,
INDArray result)
In place subtraction of this ndarray
|
INDArray |
subiColumnVector(INDArray columnVector)
In place addition of a column vector
|
INDArray |
subiRowVector(INDArray rowVector)
In place addition of a column vector
|
INDArray |
subRowVector(INDArray rowVector)
In place addition of a column vector
|
INDArray |
sum(INDArray result,
int... dimension)
Returns the sum along the last dimension of this ndarray
|
INDArray |
sum(int... dimension)
Returns the sum along the last dimension of this ndarray
|
IComplexNumber |
sumComplex()
Sum the entire array
|
Number |
sumNumber()
Sum the entire array
|
INDArray |
swapAxes(int dimension,
int with)
Mainly here for people coming from numpy.
|
INDArray |
tensorAlongDimension(int index,
int... dimension)
Get the vector along a particular dimension
|
int |
tensorssAlongDimension(int... dimension)
Returns the number of possible vectors for a given dimension
|
INDArray |
toDense()
Return a dense representation of the sparse ndarray
|
double[][] |
toDoubleMatrix()
Convert this ndarray to a 2d double matrix.
|
double[] |
toDoubleVector()
Convert this ndarray to a 1d double matrix.
|
int |
toFlatArray(com.google.flatbuffers.FlatBufferBuilder builder)
Add an
INDArray
to flatbuffers builder |
float[][] |
toFloatMatrix()
Convert this ndarray to a 2d float matrix.
|
float[] |
toFloatVector()
Convert this ndarray to a 1d float vector.
|
int[][] |
toIntMatrix()
Convert this ndarray to a 2d int matrix.
|
int[] |
toIntVector()
Convert this ndarray to a 1d int matrix.
|
String |
toString()
Generate string representation of the matrix.
|
INDArray |
transpose()
Return transposed copy of this matrix.
|
INDArray |
transposei()
Return transposed version of this matrix.
|
int |
underlyingRank() |
INDArray |
var(boolean biasCorrected,
int... dimension)
Returns the overall variance of this ndarray
|
INDArray |
var(int... dimension)
Returns the overall variance of this ndarray
|
IComplexNumber |
varComplex() |
Number |
varNumber()
Returns the overall variance of all values in this INDArray
|
INDArray |
vectorAlongDimension(int index,
int dimension)
Get the vector along a particular dimension
|
int |
vectorsAlongDimension(int dimension)
Returns the number of possible vectors for a given dimension
|
protected void |
write(ObjectOutputStream out) |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitunsafeDuplication, unsafeDuplicationforEach, spliteratorprotected transient volatile DataBuffer shapeInformation
protected transient volatile DataBuffer data
protected transient boolean compressed
protected int[] javaShapeInformation
public BaseNDArray()
public BaseNDArray(DataBuffer buffer)
buffer - public BaseNDArray(DataBuffer buffer, int[] shape, int[] stride, long offset, char ordering)
buffer - shape - stride - offset - ordering - public BaseNDArray(double[][] data)
data - public BaseNDArray(double[][] data,
char ordering)
data - ordering - public BaseNDArray(int[] shape,
DataBuffer buffer)
shape - the shapebuffer - the bufferpublic BaseNDArray(float[] data,
int[] shape,
char ordering)
data - the data to useshape - the shape of the ndarraypublic BaseNDArray(float[] data,
int[] shape,
long offset,
char ordering)
data - the data to useshape - the shape of the ndarrayoffset - the desired offsetordering - the ordering of the ndarraypublic BaseNDArray(int[] shape,
int[] stride,
long offset,
char ordering)
shape - the shape of the ndarraystride - the stride of the ndarrayoffset - the desired offsetordering - the ordering of the ndarraypublic BaseNDArray(int[] shape,
int[] stride,
long offset,
char ordering,
boolean initialize)
shape - the shape of the ndarraystride - the stride of the ndarrayoffset - the desired offsetordering - the ordering of the ndarrayinitialize - Whether to initialize the INDArray. If true: initialize. If false: don't.public BaseNDArray(int[] shape,
int[] stride,
char ordering)
shape - the shape of the ndarraystride - the stride of the ndarrayordering - the ordering of the ndarraypublic BaseNDArray(int[] shape,
long offset,
char ordering)
shape - offset - ordering - public BaseNDArray(int[] shape)
shape - public BaseNDArray(int newRows,
int newColumns,
char ordering)
newRows - the number of rows (n) of the new matrix.newColumns - the number of columns (m) of the new matrix.public BaseNDArray(List<INDArray> slices, int[] shape, char ordering)
slices - the slices to mergeshape - the shape of the ndarraypublic BaseNDArray(List<INDArray> slices, int[] shape, int[] stride, char ordering)
slices - the slices to mergeshape - the shape of the ndarraypublic BaseNDArray(float[] data,
int[] shape,
int[] stride,
char ordering)
data - shape - stride - ordering - public BaseNDArray(float[] data,
int[] shape,
int[] stride,
long offset,
char ordering)
data - shape - stride - offset - ordering - public BaseNDArray(DataBuffer data, int[] shape, int[] stride, long offset)
data - shape - stride - offset - public BaseNDArray(int[] data,
int[] shape,
int[] strides)
data - shape - strides - public BaseNDArray(DataBuffer data, int[] shape)
data - shape - public BaseNDArray(DataBuffer buffer, int[] shape, long offset)
buffer - shape - offset - public BaseNDArray(DataBuffer buffer, int[] shape, char ordering)
buffer - shape - ordering - public BaseNDArray(double[] data,
int[] shape,
char ordering)
data - shape - ordering - public BaseNDArray(double[] data,
int[] shape,
int[] stride,
long offset,
char ordering)
data - shape - stride - offset - ordering - public BaseNDArray(float[] data,
char order)
data - order - public BaseNDArray(DataBuffer floatBuffer, char order)
floatBuffer - order - public BaseNDArray(DataBuffer buffer, int[] shape, int[] strides)
buffer - shape - strides - public BaseNDArray(float[] data,
int[] shape)
data - the data to useshape - the shape of the ndarraypublic BaseNDArray(float[] data,
int[] shape,
long offset)
data - shape - offset - public BaseNDArray(int[] shape,
int[] stride,
long offset)
shape - the shape of the ndarraystride - the stride of the ndarrayoffset - the desired offsetpublic BaseNDArray(int[] shape,
int[] stride)
shape - the shape of the ndarraystride - the stride of the ndarraypublic BaseNDArray(int[] shape,
long offset)
shape - offset - public BaseNDArray(int[] shape,
char ordering)
shape - ordering - public BaseNDArray(int newRows,
int newColumns)
newRows - the number of rows (n) of the new matrix.newColumns - the number of columns (m) of the new matrix.public BaseNDArray(List<INDArray> slices, int[] shape)
slices - the slices to mergeshape - the shape of the ndarraypublic BaseNDArray(List<INDArray> slices, int[] shape, int[] stride)
slices - the slices to mergeshape - the shape of the ndarraypublic BaseNDArray(float[] data,
int[] shape,
int[] stride)
data - shape - stride - public BaseNDArray(float[] data,
int[] shape,
int[] stride,
long offset)
data - shape - stride - offset - public BaseNDArray(float[] data)
data - public BaseNDArray(float[][] data)
data - public BaseNDArray(float[][] data,
char ordering)
data - ordering - public BaseNDArray(DataBuffer buffer, int[] shape, long offset, char ordering)
buffer - shape - offset - ordering - public BaseNDArray(double[] data,
int[] shape,
int[] stride,
long offset)
public boolean isCompressed()
isCompressed in interface INDArraypublic void markAsCompressed(boolean reallyCompressed)
markAsCompressed in interface INDArrayreallyCompressed - protected static DataBuffer internalCreateBuffer(float[] data)
protected static DataBuffer internalCreateBuffer(double[] data)
protected static DataBuffer internalCreateBuffer(int[] data)
protected static DataBuffer internalCreateBuffer(float[] data, long offset)
protected static DataBuffer internalCreateBuffer(double[] data, long offset)
protected static DataBuffer internalCreateBuffer(int[] data, long offset)
@Deprecated public void setWrapAround(boolean wrapAround)
INDArraysetWrapAround in interface INDArraywrapAround - thewrap around@Deprecated public boolean isWrapAround()
INDArrayisWrapAround in interface INDArray@Deprecated public boolean isValid()
@Deprecated public INDArray linearViewColumnOrder()
INDArraylinearViewColumnOrder in interface INDArrayprotected INDArray create(DataBuffer data, int[] shape, long offset)
public INDArray linearView()
linearView in interface INDArraypublic void resetLinearView()
INDArrayresetLinearView in interface INDArraypublic int elementWiseStride()
INDArrayelementWiseStride in interface INDArraypublic int elementStride()
INDArrayelementStride in interface INDArray@Deprecated public int majorStride()
INDArraymajorStride in interface INDArray@Deprecated public int secondaryStride()
INDArraysecondaryStride in interface INDArraypublic int tensorssAlongDimension(int... dimension)
INDArraytensorssAlongDimension in interface INDArraydimension - the dimension to calculate the number of vectors forpublic INDArray tensorAlongDimension(int index, int... dimension)
INDArraytensorAlongDimension in interface INDArrayindex - the index of the vector to getScalardimension - the dimension to getScalar the vector frompublic INDArray javaTensorAlongDimension(int index, int... dimension)
javaTensorAlongDimension in interface INDArrayindex - the index of the vector to getScalardimension - the dimension to getScalar the vector frompublic int vectorsAlongDimension(int dimension)
vectorsAlongDimension in interface INDArraydimension - the dimension to calculate the number of vectors forpublic INDArray vectorAlongDimension(int index, int dimension)
vectorAlongDimension in interface INDArrayindex - the index of the vector to getdimension - the dimension to get the vector frompublic void setOrder(char order)
INDArraypublic void setShape(int... shape)
INDArraypublic void setStride(int[] stride)
INDArraypublic void setShapeAndStride(int[] shape,
int[] stride)
INDArraysetShapeAndStride in interface INDArraypublic INDArray cumsumi(int dimension)
public Number normmaxNumber()
INDArraynormmaxNumber in interface INDArraypublic IComplexNumber normmaxComplex()
normmaxComplex in interface INDArraypublic Number norm2Number()
INDArraynorm2Number in interface INDArraypublic IComplexNumber norm2Complex()
norm2Complex in interface INDArraypublic Number norm1Number()
INDArraynorm1Number in interface INDArraypublic IComplexNumber norm1Complex()
INDArraynorm1Complex in interface INDArraypublic Number stdNumber()
INDArraypublic IComplexNumber stdComplex()
stdComplex in interface INDArraypublic Number prodNumber()
INDArrayprodNumber in interface INDArraypublic IComplexNumber prodComplex()
prodComplex in interface INDArraypublic Number meanNumber()
INDArraymeanNumber in interface INDArraypublic Number ameanNumber()
INDArrayameanNumber in interface INDArraypublic IComplexNumber meanComplex()
meanComplex in interface INDArraypublic Number varNumber()
INDArraypublic IComplexNumber varComplex()
varComplex in interface INDArraypublic Number maxNumber()
INDArraypublic Number amaxNumber()
INDArrayamaxNumber in interface INDArraypublic IComplexNumber maxComplex()
maxComplex in interface INDArraypublic Number minNumber()
INDArraypublic Number aminNumber()
INDArrayaminNumber in interface INDArraypublic Number scan(Condition condition)
INDArraypublic IComplexNumber minComplex()
minComplex in interface INDArraypublic Number sumNumber()
INDArraypublic Number entropyNumber()
entropyNumber in interface INDArraypublic Number shannonEntropyNumber()
shannonEntropyNumber in interface INDArraypublic Number logEntropyNumber()
logEntropyNumber in interface INDArraypublic IComplexNumber sumComplex()
INDArraysumComplex in interface INDArraypublic INDArray cumsum(int dimension)
public INDArray assign(INDArray arr)
public INDArray putScalar(int i, double value)
INDArraypublic INDArray putScalar(int i, float value)
INDArraypublic INDArray putScalar(int i, int value)
INDArraypublic INDArray putScalar(int[] indexes, double value)
INDArraypublic INDArray putScalar(int row, int col, double value)
INDArrayINDArray.putScalar(int[], double) but avoids int[] creationpublic INDArray putScalar(int dim0, int dim1, int dim2, double value)
INDArrayINDArray.putScalar(int[], double) but avoids int[] creationpublic INDArray putScalar(int dim0, int dim1, int dim2, int dim3, double value)
INDArrayINDArray.putScalar(int[], double) but avoids int[] creationpublic INDArray putScalar(int[] indexes, float value)
INDArraypublic INDArray putScalar(int[] indexes, int value)
INDArraypublic INDArray eps(INDArray other)
public INDArray epsi(INDArray other)
public INDArray lt(Number other)
INDArraypublic INDArray lte(Number other)
INDArraypublic INDArray lti(Number other)
INDArraypublic INDArray ltei(Number other)
INDArraypublic INDArray eq(Number other)
INDArraypublic INDArray eqi(Number other)
INDArraypublic INDArray gt(Number other)
INDArraypublic INDArray gte(Number other)
INDArraypublic INDArray gtei(Number other)
INDArraypublic INDArray gti(Number other)
INDArraypublic INDArray lt(INDArray other)
INDArraypublic INDArray lti(INDArray other)
INDArraypublic INDArray neq(Number other)
INDArraypublic INDArray neqi(Number other)
INDArraypublic INDArray neq(INDArray other)
INDArraypublic INDArray neqi(INDArray other)
INDArraypublic INDArray eq(INDArray other)
INDArraypublic INDArray eqi(INDArray other)
INDArraypublic INDArray gt(INDArray other)
INDArraypublic INDArray gti(INDArray other)
INDArraypublic INDArray neg()
public INDArray negi()
public INDArray rdiv(Number n, INDArray result)
INDArraypublic INDArray rdivi(Number n, INDArray result)
INDArraypublic INDArray rsub(Number n, INDArray result)
INDArraypublic INDArray rsubi(Number n, INDArray result)
INDArraypublic INDArray divi(Number n, INDArray result)
INDArraypublic INDArray muli(Number n, INDArray result)
INDArraypublic INDArray subi(Number n, INDArray result)
INDArraypublic INDArray addi(Number n, INDArray result)
INDArraypublic INDArray getScalar(int row, int column)
public INDArray dup()
INDArraypublic INDArray dup(char order)
INDArraypublic int getInt(int... indices)
public double getDouble(int... indices)
public float getFloat(int... indices)
public boolean isScalar()
public INDArray match(INDArray comp, Condition condition)
INDArraypublic INDArray match(Number comp, Condition condition)
INDArraypublic INDArray getWhere(INDArray comp, Condition condition)
INDArraypublic INDArray getWhere(Number comp, Condition condition)
INDArraypublic INDArray putWhere(INDArray comp, INDArray put, Condition condition)
INDArraypublic INDArray putWhere(Number comp, INDArray put, Condition condition)
INDArraypublic INDArray putWhere(Number comp, Number put, Condition condition)
INDArraypublic INDArray putWhereWithMask(INDArray mask, INDArray put)
INDArrayputWhereWithMask in interface INDArraymask - the mask to useput - the array to putpublic INDArray putWhereWithMask(INDArray mask, Number put)
INDArrayputWhereWithMask in interface INDArraymask - the mask to useput - the array to putpublic INDArray putSlice(int slice, INDArray put)
protected void assertSlice(INDArray put, int slice)
public boolean isMatrix()
@Deprecated public int index(int row, int column)
INDArrayprotected INDArray newShape(int[] newShape, char ordering)
protected INDArray create(DataBuffer data, int[] newShape, int[] newStrides, long offset, char ordering)
protected INDArray create(DataBuffer data, int[] newShape, int[] newStrides, long offset)
protected INDArray create(int[] shape)
protected INDArray create(int[] shape, int[] strides, long offset)
protected int[] getStrides(int[] shape,
char ordering)
public double squaredDistance(INDArray other)
squaredDistance in interface INDArraypublic double distance2(INDArray other)
public double distance1(INDArray other)
public INDArray get(INDArray indices)
INDArraypublic INDArray get(List<List<Integer>> indices)
INDArraypublic INDArray put(List<List<Integer>> indices, INDArray element)
INDArraypublic INDArray put(INDArray indices, INDArray element)
INDArraypublic INDArray put(INDArrayIndex[] indices, INDArray element)
INDArraypublic INDArray put(INDArrayIndex[] indices, Number element)
INDArraypublic INDArray swapAxes(int dimension, int with)
public boolean isView()
INDArraypublic boolean isSparse()
INDArraypublic DataBuffer data()
INDArraypublic void setData(DataBuffer data)
public int slices()
public INDArray subArray(ShapeOffsetResolution resolution)
INDArraypublic INDArray subArray(long[] offsets, int[] shape, int[] stride)
protected INDArray create(DataBuffer buffer)
public INDArray cond(Condition condition)
INDArraypublic INDArray condi(Condition condition)
INDArrayprotected void init(int[] shape,
int[] stride)
public INDArray getScalar(int i)
INDArrayprotected INDArray doColumnWise(INDArray columnVector, char operation)
columnVector - the column vectoroperation - the operation@Deprecated public boolean isCleanedUp()
INDArrayisCleanedUp in interface INDArray@Deprecated public void cleanup()
INDArrayprotected INDArray doRowWise(INDArray rowVector, char operation)
rowVector - the row vectoroperation - the operationprotected DataBuffer shapeOf()
protected DataBuffer strideOf()
public int stride(int dimension)
INDArraypublic INDArray rdiviColumnVector(INDArray columnVector)
INDArrayrdiviColumnVector in interface INDArraycolumnVector - the column vector used for divisionpublic INDArray rdivColumnVector(INDArray columnVector)
INDArrayrdivColumnVector in interface INDArraycolumnVector - the column vector used for divisionpublic INDArray rdiviRowVector(INDArray rowVector)
INDArrayrdiviRowVector in interface INDArrayrowVector - the row vector used for divisionpublic INDArray rdivRowVector(INDArray rowVector)
INDArrayrdivRowVector in interface INDArrayrowVector - the row vector used for divisionpublic INDArray rsubiColumnVector(INDArray columnVector)
INDArrayrsubiColumnVector in interface INDArraycolumnVector - the column vector to subtractpublic INDArray rsubColumnVector(INDArray columnVector)
INDArrayrsubColumnVector in interface INDArraycolumnVector - the column vector to subtractpublic INDArray rsubiRowVector(INDArray rowVector)
INDArrayrsubiRowVector in interface INDArrayrowVector - the row vector to subtractpublic INDArray rsubRowVector(INDArray rowVector)
INDArrayrsubRowVector in interface INDArrayrowVector - the row vector to subtractpublic INDArray diviColumnVector(INDArray columnVector)
diviColumnVector in interface INDArraycolumnVector - the column vector to addpublic INDArray divColumnVector(INDArray columnVector)
divColumnVector in interface INDArraycolumnVector - the column vector to addpublic INDArray diviRowVector(INDArray rowVector)
diviRowVector in interface INDArrayrowVector - the row vector to addpublic INDArray divRowVector(INDArray rowVector)
divRowVector in interface INDArrayrowVector - the row vector to addpublic INDArray muliColumnVector(INDArray columnVector)
muliColumnVector in interface INDArraycolumnVector - the column vector to addpublic INDArray mulColumnVector(INDArray columnVector)
mulColumnVector in interface INDArraycolumnVector - the column vector to addpublic INDArray muliRowVector(INDArray rowVector)
muliRowVector in interface INDArrayrowVector - the row vector to addpublic INDArray mulRowVector(INDArray rowVector)
mulRowVector in interface INDArrayrowVector - the row vector to addpublic INDArray subiColumnVector(INDArray columnVector)
subiColumnVector in interface INDArraycolumnVector - the column vector to addpublic INDArray subColumnVector(INDArray columnVector)
subColumnVector in interface INDArraycolumnVector - the column vector to addpublic INDArray subiRowVector(INDArray rowVector)
subiRowVector in interface INDArrayrowVector - the row vector to addpublic INDArray subRowVector(INDArray rowVector)
subRowVector in interface INDArrayrowVector - the row vector to addpublic INDArray addiColumnVector(INDArray columnVector)
addiColumnVector in interface INDArraycolumnVector - the column vector to addpublic INDArray putiColumnVector(INDArray columnVector)
INDArrayputiColumnVector in interface INDArraycolumnVector - the column vector to addpublic INDArray addColumnVector(INDArray columnVector)
addColumnVector in interface INDArraycolumnVector - the column vector to addpublic INDArray addiRowVector(INDArray rowVector)
addiRowVector in interface INDArrayrowVector - the row vector to addpublic INDArray putiRowVector(INDArray rowVector)
INDArrayputiRowVector in interface INDArrayrowVector - Row vector to putpublic INDArray addRowVector(INDArray rowVector)
addRowVector in interface INDArrayrowVector - the row vector to addpublic INDArray mmul(INDArray other, INDArray result, MMulTranspose mMulTranspose)
public INDArray mmul(INDArray other, MMulTranspose mMulTranspose)
protected INDArray create(int[] shape, char ordering)
public double[][] toDoubleMatrix()
INDArraytoDoubleMatrix in interface INDArraypublic double[] toDoubleVector()
INDArraytoDoubleVector in interface INDArraypublic float[] toFloatVector()
INDArraytoFloatVector in interface INDArraypublic float[][] toFloatMatrix()
INDArraytoFloatMatrix in interface INDArraypublic int[] toIntVector()
INDArraytoIntVector in interface INDArraypublic int[][] toIntMatrix()
INDArraytoIntMatrix in interface INDArraypublic INDArray div(INDArray other, INDArray result)
public INDArray mul(INDArray other, INDArray result)
public INDArray mmuli(INDArray other, MMulTranspose transpose)
public INDArray mmuli(INDArray other, INDArray result, MMulTranspose transpose)
public INDArray divi(INDArray other, INDArray result)
public INDArray muli(INDArray other, INDArray result)
public INDArray normmax(int... dimension)
public INDArray rsub(INDArray other)
INDArraypublic INDArray rsubi(INDArray other)
INDArraypublic INDArray assignIf(INDArray arr, Condition condition)
public INDArray replaceWhere(INDArray arr, Condition condition)
replaceWhere in interface INDArrayarr - condition - @Deprecated public int linearIndex(int i)
INDArraylinearIndex in interface INDArrayi - the index to getScalarpublic INDArray slice(int slice)
protected INDArray createScalarForIndex(int i, boolean applyOffset)
protected INDArray createScalar(double d)
public int getTrailingOnes()
INDArraygetTrailingOnes in interface INDArraypublic int getLeadingOnes()
INDArraygetLeadingOnes in interface INDArraypublic INDArray slice(int slice, int dimension)
public INDArray getScalar(int... indexes)
public INDArray rdiv(Number n)
INDArraypublic INDArray rdivi(Number n)
INDArraypublic INDArray rsub(Number n)
INDArraypublic INDArray rsubi(Number n)
INDArraypublic INDArray divi(Number n)
INDArraypublic INDArray mul(Number n)
INDArraypublic INDArray muli(Number n)
INDArraypublic INDArray sub(Number n)
INDArraypublic INDArray subi(Number n)
INDArraypublic INDArray add(Number n)
INDArraypublic INDArray addi(Number n)
INDArraypublic INDArray repmat(int[] shape)
public INDArray repeat(int dimension, int... repeats)
INDArraypublic INDArray putRow(int row, INDArray toPut)
public INDArray putColumn(int column, INDArray toPut)
public double getDouble(int i)
INDArraypublic double getDouble(int i,
int j)
INDArraypublic float getFloat(int i)
INDArraypublic float getFloat(int i,
int j)
INDArraypublic INDArray transpose()
public INDArray transposei()
transposei in interface INDArrayprotected INDArray create(DataBuffer data, int[] shape, int[] strides)
public INDArray reshape(char order, int... newShape)
INDArraypublic double getDoubleUnsafe(long offset)
INDArraygetDoubleUnsafe in interface INDArrayoffset - the offset to get atpublic INDArray putScalarUnsafe(long offset, double value)
INDArrayputScalarUnsafe in interface INDArrayoffset - the offset to insert atvalue - the value to insertpublic int innerMostStride()
INDArrayinnerMostStride in interface INDArraypublic INDArray reshape(char order, int rows, int columns)
INDArraypublic INDArray reshape(int... shape)
public void checkDimensions(INDArray other)
INDArraycheckDimensions in interface INDArrayother - the other ndarray to comparepublic INDArray prod(int... dimension)
public INDArray mean(int... dimension)
public INDArray amean(int... dimension)
INDArraypublic INDArray mean(@NonNull INDArray result, int... dimension)
INDArraypublic INDArray var(int... dimension)
public INDArray var(boolean biasCorrected, int... dimension)
public INDArray max(int... dimension)
public INDArray amax(int... dimension)
INDArraypublic INDArray min(int... dimension)
public INDArray amin(int... dimension)
INDArraypublic INDArray sum(int... dimension)
public INDArray entropy(int... dimension)
public INDArray shannonEntropy(int... dimension)
shannonEntropy in interface INDArraydimension - public INDArray logEntropy(int... dimension)
logEntropy in interface INDArraydimension - public INDArray sum(@NonNull INDArray result, int... dimension)
INDArraypublic INDArray norm1(int... dimension)
public INDArray std(int... dimension)
public INDArray std(boolean biasCorrected, int... dimension)
INDArraypublic Number stdNumber(boolean biasCorrected)
INDArraypublic INDArray norm2(int... dimension)
public int columns()
public int rows()
public INDArray ravel(char ordering)
public INDArray ravel()
public void sliceVectors(List<INDArray> list)
sliceVectors in interface INDArraypublic INDArray reshape(int newRows, int newColumns)
public INDArray getColumn(int c)
public INDArray getRows(int[] rindices)
public INDArray get(INDArrayIndex... indexes)
public INDArray getColumns(int... cindices)
getColumns in interface INDArraycindices - protected INDArray create(int rows, int length)
public INDArray getRow(int r)
public boolean equalsWithEps(Object o, double eps)
equalsWithEps in interface INDArrayo - eps - public boolean equals(Object o)
public DataBuffer shapeInfoDataBuffer()
INDArrayshapeInfoDataBuffer in interface INDArraypublic int[] shape()
public String shapeInfoToString()
shapeInfoToString in interface INDArraypublic int[] stride()
public long offset()
INDArraypublic char ordering()
INDArraypublic int size(int dimension)
public int rank()
INDArraypublic int length()
public long lengthLong()
lengthLong in interface INDArraypublic INDArray broadcast(INDArray result)
INDArraypublic INDArray broadcast(int... shape)
public INDArray dimShuffle(Object[] rearrange, int[] newOrder, boolean[] broadCastable)
dimShuffle in interface INDArrayrearrange - the dimensions to swap tonewOrder - the new order (think permute)broadCastable - (whether the dimension is broadcastable) (must be same length as new order)public INDArray permute(int... rearrange)
public INDArray permutei(int... rearrange)
protected int[] doPermuteSwap(IntBuffer shape, int[] rearrange)
protected int[] doPermuteSwap(DataBuffer shape, int[] rearrange)
protected void checkArrangeArray(int[] arr)
protected void autoProcessScalarCall()
public boolean isVector()
public boolean isVectorOrScalar()
INDArrayisVectorOrScalar in interface INDArraypublic boolean isSquare()
INDArraypublic boolean isRowVector()
isRowVector in interface INDArraypublic boolean isColumnVector()
isColumnVector in interface INDArraypublic boolean isColumnVectorOrScalar()
INDArrayisColumnVectorOrScalar in interface INDArraypublic boolean isRowVectorOrScalar()
INDArrayisRowVectorOrScalar in interface INDArraypublic String toString()
public Object element()
public IComplexNDArray rdiv(IComplexNumber n)
public IComplexNDArray rdivi(IComplexNumber n)
public IComplexNDArray rsub(IComplexNumber n)
public IComplexNDArray rsubi(IComplexNumber n)
public IComplexNDArray div(IComplexNumber n)
public IComplexNDArray divi(IComplexNumber n)
public IComplexNDArray mul(IComplexNumber n)
public IComplexNDArray muli(IComplexNumber n)
public IComplexNDArray sub(IComplexNumber n)
public IComplexNDArray subi(IComplexNumber n)
public IComplexNDArray add(IComplexNumber n)
public IComplexNDArray addi(IComplexNumber n)
public IComplexNDArray rdiv(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray rdivi(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray rsub(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray rsubi(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray div(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray divi(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray mul(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray muli(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray sub(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray subi(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray add(IComplexNumber n, IComplexNDArray result)
public IComplexNDArray addi(IComplexNumber n, IComplexNDArray result)
public INDArray remainder(INDArray denominator)
INDArraypublic INDArray remainder(INDArray denominator, INDArray result)
INDArraypublic INDArray remainder(Number denominator)
INDArraypublic INDArray remainderi(INDArray denominator)
INDArrayremainderi in interface INDArraypublic INDArray remainderi(Number denominator)
INDArrayremainderi in interface INDArraypublic INDArray fmod(INDArray denominator)
INDArraypublic INDArray fmod(INDArray denominator, INDArray result)
INDArraypublic INDArray fmodi(INDArray denominator)
INDArraypublic INDArray fmodi(Number denominator)
INDArraypublic long originalOffset()
originalOffset in interface INDArrayprotected void write(ObjectOutputStream out) throws IOException
IOExceptionprotected void read(ObjectInputStream s)
public INDArray argMax(int... dimension)
public boolean isAttached()
isAttached in interface INDArraypublic boolean isInScope()
PLEASE NOTE: if this INDArray isn't attached to any Workspace, this method will return true
public INDArray detach()
PLEASE NOTE: If this INDArray instance is NOT attached - it will be returned unmodified.
public INDArray leverage()
PLEASE NOTE: If this INDArray instance is NOT attached - it will be returned unmodified. PLEASE NOTE: If current Workspace is the top-tier one, effect will be equal to detach() call - detached copy will be returned
public INDArray leverageTo(String id)
leverageTo in interface INDArrayid - INDArray.leverageTo(String, boolean)public INDArray leverageTo(String id, boolean enforceExistence) throws Nd4jNoSuchWorkspaceException
Nd4jNoSuchWorkspaceException
is thrown. Otherwise, if enforceExistance == false and no workspace with the specified ID exists, then the current
INDArray is returned unmodified (same as leverage()leverageTo in interface INDArrayid - ID of the workspace to leverage toenforceExistence - If true, and the specified workspace does not exist: an Nd4jNoSuchWorkspaceException
will be thrown.Nd4jNoSuchWorkspaceExceptionleverageTo(String)public INDArray leverageOrDetach(String id)
leverageOrDetach in interface INDArrayid - ID of the workspace to leverage toleverageTo(String)public INDArray migrate()
migrate in interface INDArraymigrate(boolean)public INDArray migrate(boolean detachOnNoWs)
migrate()public Number percentileNumber(Number quantile)
INDArraypercentileNumber in interface INDArrayquantile - target percentile in range of 0..100public Number medianNumber()
INDArraymedianNumber in interface INDArraypublic INDArray median(int... dimension)
INDArraypublic INDArray percentile(Number quantile, int... dimension)
INDArraypercentile in interface INDArrayquantile - target percentile in range of 0..100dimension - Dimension to calculate percentile forpublic int toFlatArray(com.google.flatbuffers.FlatBufferBuilder builder)
INDArrayINDArray
to flatbuffers buildertoFlatArray in interface INDArraybuilder - the builder to usepublic DataBuffer getVectorCoordinates()
INDArraygetVectorCoordinates in interface INDArraypublic INDArray toDense()
INDArraypublic int nnz()
INDArraypublic SparseFormat getFormat()
INDArraygetFormat in interface INDArraySparseFormatpublic DataBuffer sparseInfoDataBuffer()
INDArraysparseInfoDataBuffer in interface INDArraypublic int[] hiddenDimensions()
hiddenDimensions in interface INDArraypublic int[] sparseOffsets()
sparseOffsets in interface INDArraypublic int underlyingRank()
underlyingRank in interface INDArraypublic INDArray convertToFloats()
convertToFloats in interface INDArraypublic INDArray convertToDoubles()
convertToDoubles in interface INDArrayprotected static DataBuffer.TypeEx convertType(DataBuffer.Type type)
Copyright © 2018. All rights reserved.