public class Nd4j extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Nd4j.PadMode |
Constructor and Description |
---|
Nd4j() |
Modifier and Type | Method and Description |
---|---|
static INDArray |
append(INDArray arr,
int padAmount,
double val,
int axis)
Append the given
array with the specified value size
along a particular axis
|
static INDArray |
appendBias(INDArray... vectors) |
static INDArray |
arange(double end)
Array of evenly spaced values.
|
static INDArray |
arange(double begin,
double end)
Array of evenly spaced values.
|
static INDArray |
argMax(INDArray arr,
int... dimension) |
static INDArray |
bilinearProducts(INDArray curr,
INDArray in)
Returns a column vector where each entry is the nth bilinear
product of the nth slices of the two tensors.
|
static ReferenceQueue<DataBuffer> |
bufferRefQueue()
The reference queue used for cleaning up
databuffers
|
static void |
clearNans(INDArray arr)
Clear nans from an ndarray
|
static IComplexNDArray |
complexFlatten(IComplexNDArray... flatten)
Create a long row vector of all of the given ndarrays
|
static IComplexNDArray |
complexFlatten(List<IComplexNDArray> flatten)
Create a long row vector of all of the given ndarrays
|
static IComplexNDArray |
complexLinSpace(int i,
int i1,
int i2)
Linspace with complex numbers
|
static IComplexNDArray |
complexOnes(int... shape)
Create an ndarray of ones
|
static IComplexNDArray |
complexOnes(int columns)
Creates an ndarray
|
static IComplexNDArray |
complexOnes(int rows,
int columns)
Creates an ndarray
|
static IComplexNDArray |
complexRand(int... shape)
Create a random ndarray with the given shape using
the current time as the seed
|
static IComplexNDArray |
complexScalar(Number value)
Create a scalar ndarray with the specified offset
|
static IComplexNDArray |
complexScalar(Number value,
int offset)
Create a scalar ndarray with the specified offset
|
static IComplexNDArray |
complexValueOf(int[] shape,
double value) |
static IComplexNDArray |
complexValueOf(int[] shape,
IComplexNumber value) |
static IComplexNDArray |
complexValueOf(int num,
double value) |
static IComplexNDArray |
complexValueOf(int num,
IComplexNumber value) |
static IComplexNDArray |
complexZeros(int... shape)
Create an ndarray of ones
|
static IComplexNDArray |
complexZeros(int columns)
Creates an ndarray
|
static INDArray |
complexZeros(int rows,
int columns)
Creates a matrix of zeros
|
static IComplexNDArray |
concat(int dimension,
IComplexNDArray... toConcat)
Concatneate ndarrays along a dimension
|
static INDArray |
concat(int dimension,
INDArray... toConcat)
Concatneate ndarrays along a dimension
|
static void |
copy(INDArray a,
INDArray b)
Copy a to b
|
static INDArray |
create(DataBuffer buffer) |
static INDArray |
create(DataBuffer data,
int[] shape) |
static INDArray |
create(DataBuffer data,
int[] shape,
int offset) |
static INDArray |
create(DataBuffer data,
int[] shape,
int[] strides,
int offset) |
static INDArray |
create(DataBuffer data,
int[] newShape,
int[] newStride,
int offset,
char ordering) |
static INDArray |
create(double[] data)
Creates a row vector with the data
|
static INDArray |
create(double[][] data)
Create an ndarray based on the given data layout
|
static INDArray |
create(double[][] data,
char ordering) |
static INDArray |
create(double[] data,
char order)
Creates a row vector with the data
|
static INDArray |
create(double[] data,
int[] shape)
Create an ndrray with the specified shape
|
static INDArray |
create(double[] data,
int[] shape,
char ordering)
Create an ndrray with the specified shape
|
static INDArray |
create(double[] data,
int[] shape,
int offset) |
static INDArray |
create(double[] data,
int[] shape,
int[] stride,
int offset)
Creates an ndarray with the specified shape
|
static INDArray |
create(double[] data,
int[] shape,
int[] stride,
int offset,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(double[] data,
int[] shape,
int offset,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(double[] data,
int rows,
int columns,
int[] stride,
int offset)
Creates an ndarray with the specified shape
|
static INDArray |
create(double[] data,
int rows,
int columns,
int[] stride,
int offset,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(float[] data)
Creates a row vector with the data
|
static INDArray |
create(float[][] data) |
static INDArray |
create(float[][] data,
char ordering) |
static INDArray |
create(float[] data,
char order)
Creates a row vector with the data
|
static INDArray |
create(float[] data,
int[] shape)
Create an ndrray with the specified shape
|
static INDArray |
create(float[] data,
int[] shape,
char ordering)
Create an ndrray with the specified shape
|
static INDArray |
create(float[] data,
int[] shape,
char ordering,
int offset) |
static INDArray |
create(float[] data,
int[] shape,
int offset)
Creates an ndarray with the specified shape
|
static INDArray |
create(float[] data,
int[] shape,
int[] stride,
char ordering,
int offset) |
static INDArray |
create(float[] data,
int[] shape,
int[] stride,
int offset)
Creates an ndarray with the specified shape
|
static INDArray |
create(float[] data,
int[] shape,
int[] stride,
int offset,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(float[] data,
int rows,
int columns,
int[] stride,
int offset)
Creates an ndarray with the specified shape
|
static INDArray |
create(float[] data,
int rows,
int columns,
int[] stride,
int offset,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(int... shape)
Creates an ndarray with the specified shape
|
static INDArray |
create(int columns)
Creates a row vector with the specified number of columns
|
static INDArray |
create(int[] shape,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(int[] shape,
DataBuffer.Type dataType) |
static INDArray |
create(int[] sliceShape,
double[]... arrays)
Create an ndarray based on the given data
|
static INDArray |
create(int[] sliceShape,
float[]... arrays)
Create an ndarray based on the given data
|
static INDArray |
create(int[] shape,
int[] stride)
Creates an ndarray with the specified shape
|
static INDArray |
create(int[] shape,
int[] stride,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(int[] shape,
int[] stride,
int offset)
Creates an ndarray with the specified shape
|
static INDArray |
create(int[] shape,
int[] stride,
int offset,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(int columns,
char order)
Creates a row vector with the specified number of columns
|
static INDArray |
create(int rows,
int columns)
Creates an ndarray with the specified shape
|
static INDArray |
create(int rows,
int columns,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(int rows,
int columns,
int[] stride)
Creates an ndarray with the specified shape
|
static INDArray |
create(int rows,
int columns,
int[] stride,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(int rows,
int columns,
int[] stride,
int offset)
Creates an ndarray with the specified shape
|
static INDArray |
create(int rows,
int columns,
int[] stride,
int offset,
char ordering)
Creates an ndarray with the specified shape
|
static INDArray |
create(List<INDArray> list,
int[] shape)
Creates an ndarray with the specified shape
|
static INDArray |
create(List<INDArray> list,
int[] shape,
char ordering)
Creates an ndarray with the specified shape
|
static DataBuffer |
createBuffer(byte[] data,
int length)
Create a buffer based on the data type
|
static DataBuffer |
createBuffer(double[] data)
Create a buffer based on the data type
|
static DataBuffer |
createBuffer(float[] data)
Create a buffer based on the data type
|
static DataBuffer |
createBuffer(int length)
Creates a buffer of the specified length based on the data type
|
static DataBuffer |
createBuffer(int[] shape)
Create a buffer equal of length prod(shape)
|
static DataBuffer |
createBuffer(int[] shape,
DataBuffer.Type type)
Create a buffer equal of length prod(shape)
|
static IComplexNDArray |
createComplex(DataBuffer data,
int[] shape) |
static IComplexNDArray |
createComplex(DataBuffer data,
int[] shape,
int offset) |
static IComplexNDArray |
createComplex(DataBuffer data,
int[] shape,
int[] newStrides,
int offset) |
static IComplexNDArray |
createComplex(DataBuffer data,
int[] shape,
int[] newStrides,
int offset,
char ordering) |
static IComplexNDArray |
createComplex(DataBuffer data,
int[] shape,
int offset,
char ordering) |
static IComplexNDArray |
createComplex(double[] dim) |
static IComplexNDArray |
createComplex(double[] data,
char order)
Creates an ndarray with the specified data
|
static IComplexNDArray |
createComplex(double[] data,
int[] shape)
Create an ndrray with the specified shape
|
static IComplexNDArray |
createComplex(double[] data,
int[] shape,
char ordering)
Create an ndrray with the specified shape
|
static IComplexNDArray |
createComplex(double[] data,
int[] shape,
int offset) |
static IComplexNDArray |
createComplex(double[] data,
int[] shape,
int[] stride)
Create an ndrray with the specified shape
|
static IComplexNDArray |
createComplex(double[] data,
int[] shape,
int[] stride,
char ordering)
Create an ndrray with the specified shape
|
static IComplexNDArray |
createComplex(double[] data,
int[] shape,
int[] stride,
int offset)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(double[] data,
int[] shape,
int[] stride,
int offset,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(double[] data,
int[] shape,
int offset,
char ordering) |
static IComplexNDArray |
createComplex(double[] data,
int rows,
int columns,
int[] stride,
int offset)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(double[] data,
int rows,
int columns,
int[] stride,
int offset,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(float[] data)
Creates an ndarray with the specified data
|
static IComplexNDArray |
createComplex(float[] data,
int[] shape)
Create an ndrray with the specified shape
|
static IComplexNDArray |
createComplex(float[] data,
int[] shape,
char ordering)
Create an ndrray with the specified shape
|
static IComplexNDArray |
createComplex(float[] data,
int[] shape,
int offset) |
static IComplexNDArray |
createComplex(float[] data,
int[] shape,
int[] stride)
Create an ndrray with the specified shape
|
static IComplexNDArray |
createComplex(float[] data,
int[] shape,
int[] stride,
char ordering)
Create an ndrray with the specified shape
|
static IComplexNDArray |
createComplex(float[] data,
int[] shape,
int[] stride,
int offset)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(float[] data,
int[] shape,
int[] stride,
int offset,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(float[] data,
int[] shape,
int offset,
char ordering)
Create complex ndarray
|
static IComplexNDArray |
createComplex(float[] data,
int rows,
int columns,
int[] stride,
int offset)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(float[] data,
int rows,
int columns,
int[] stride,
int offset,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(IComplexNumber[] iComplexNumbers)
Create a complex array from the given numbers
|
static IComplexNDArray |
createComplex(IComplexNumber[][] iComplexNumbers)
Create a complex ndarray based on the specified matrices
|
static IComplexNDArray |
createComplex(IComplexNumber[] data,
int[] shape)
Create a complex ndarray from the passed in indarray
|
static IComplexNDArray |
createComplex(IComplexNumber[] data,
int[] shape,
int offset,
char order)
Create a complex ndarray from the passed in indarray
|
static IComplexNDArray |
createComplex(INDArray arr)
Create a complex ndarray from the passed in indarray
|
static IComplexNDArray |
createComplex(INDArray real,
INDArray imag)
Create a complex ndarray based on the
real and imaginary
|
static IComplexNDArray |
createComplex(int... shape)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int columns)
Creates an ndarray
|
static IComplexNDArray |
createComplex(int[] shape,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int[] shape,
int[] stride)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int[] shape,
int[] stride,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int[] shape,
int[] stride,
int offset)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int[] shape,
int[] stride,
int offset,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int columns,
char order)
Creates an ndarray
|
static IComplexNDArray |
createComplex(int rows,
int columns)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int rows,
int columns,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int rows,
int columns,
int[] stride)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int rows,
int columns,
int[] stride,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int rows,
int columns,
int[] stride,
int offset)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(int rows,
int columns,
int[] stride,
int offset,
char ordering)
Creates a complex ndarray with the specified shape
|
static IComplexNDArray |
createComplex(List<IComplexNDArray> arrs,
int[] shape)
Create a complex ndarray from the passed in indarray
|
static IComplexNumber |
createComplexNumber(Number real,
Number imag)
Create double based on real and imaginary
|
static IComplexDouble |
createDouble(double real,
double imag)
Create an instance of a complex double
|
static IComplexFloat |
createFloat(float real,
float imag)
Create double
|
static IComplexNDArray |
cumsum(IComplexNDArray compute) |
static IComplexNDArray |
cumsum(IComplexNDArray compute,
int dimension) |
static INDArray |
cumsum(INDArray compute) |
static INDArray |
cumsum(INDArray compute,
int dimension) |
static DataBuffer.Type |
dataType()
Returns the data type used for the runtime
|
static IComplexNDArray |
diag(IComplexNDArray x)
Creates a new matrix where the values of the given vector are the diagonal values of
the matrix if a vector is passed in, if a matrix is returns the kth diagonal
in the matrix
|
static IComplexNDArray |
diag(IComplexNDArray x,
int k)
Creates a new matrix where the values of the given vector are the diagonal values of
the matrix if a vector is passed in, if a matrix is returns the kth diagonal
in the matrix
|
static INDArray |
diag(INDArray x)
Creates a new matrix where the values of the given vector are the diagonal values of
the matrix if a vector is passed in, if a matrix is returns the kth diagonal
in the matrix
|
static INDArray |
diag(INDArray x,
int k)
Creates a new matrix where the values of the given vector are the diagonal values of
the matrix if a vector is passed in, if a matrix is returns the kth diagonal
in the matrix
|
static void |
doAlongDiagonal(IComplexNDArray x,
com.google.common.base.Function<IComplexNumber,IComplexNumber> func)
Perform an operation along a diagonal
|
static void |
doAlongDiagonal(INDArray x,
com.google.common.base.Function<Number,Number> func)
Perform an operation along a diagonal
|
static INDArray |
emptyLike(INDArray arr)
Empty like
|
static INDArray |
eye(int n)
Create the identity ndarray
|
static NDArrayFactory |
factory()
The factory used for creating ndarrays
|
static INDArray |
fromByteArray(byte[] arr)
Read an ndarray from a byte array
|
static INDArray |
gemm(INDArray a,
INDArray b,
boolean transposeA,
boolean transposeB)
Matrix multiply: Implements op(a)*op(b) where op(X) means transpose X (or not) depending on
setting of arguments transposeA and transposeB.
So gemm(a,b,false,false) == a.mmul(b), gemm(a,b,true,false) == a.transpose().mmul(b) etc. |
static INDArray |
gemm(INDArray a,
INDArray b,
INDArray c,
boolean transposeA,
boolean transposeB,
double alpha,
double beta)
Matrix multiply: Implements c = alpha*op(a)*op(b) + beta*c where op(X) means transpose X (or not)
depending on setting of arguments transposeA and transposeB.
Note that matrix c MUST be fortran order, have zero offset and have c.data().length == c.length(). |
static BlasWrapper |
getBlasWrapper() |
static int[] |
getComplexStrides(int[] shape)
Get the strides based on the shape
and NDArrays.order()
|
static int[] |
getComplexStrides(int[] shape,
char order)
Get the strides for the given order and shape
|
static ConvolutionInstance |
getConvolution()
Get the convolution singleton
|
static DistributionFactory |
getDistributions()
Get the primary distributions
factory
|
static OpExecutioner |
getExecutioner()
Get the operation executioner instance
|
static FFTInstance |
getFFt()
Returns the fft instance
|
static Instrumentation |
getInstrumentation()
Gets the instrumentation instance
|
static OpFactory |
getOpFactory()
Get the operation factory
|
static Random |
getRandom()
Get the current random generator
|
static int[] |
getStrides(int[] shape)
Get the strides based on the shape
and NDArrays.order()
|
static int[] |
getStrides(int[] shape,
char order)
Get the strides for the given order and shape
|
static TaskFactory |
getTaskFactory()
Get the task factory
|
static boolean |
hasInvalidNumber(INDArray num)
Returns true if the given ndarray has either
an infinite or nan
|
static INDArray |
hstack(INDArray... arrs)
Concatenates two matrices horizontally.
|
void |
initContext()
Initializes nd4j
|
void |
initWithBackend(Nd4jBackend backend)
Initialize with the specific backend
|
static INDArray |
linspace(int lower,
int upper,
int num)
Generate a linearly spaced vector
|
static IComplexNDArray |
max(IComplexNDArray compute) |
static IComplexNDArray |
max(IComplexNDArray compute,
int dimension) |
static INDArray |
max(INDArray compute) |
static INDArray |
max(INDArray compute,
int dimension) |
static IComplexNDArray |
mean(IComplexNDArray compute) |
static IComplexNDArray |
mean(IComplexNDArray compute,
int dimension) |
static INDArray |
mean(INDArray compute) |
static INDArray |
mean(INDArray compute,
int dimension) |
static IComplexNDArray |
min(IComplexNDArray compute) |
static IComplexNDArray |
min(IComplexNDArray compute,
int dimension) |
static INDArray |
min(INDArray compute) |
static INDArray |
min(INDArray compute,
int dimension) |
static IComplexNDArray |
norm1(IComplexNDArray compute) |
static IComplexNDArray |
norm1(IComplexNDArray compute,
int dimension) |
static INDArray |
norm1(INDArray compute) |
static INDArray |
norm1(INDArray compute,
int dimension) |
static IComplexNDArray |
norm2(IComplexNDArray compute) |
static IComplexNDArray |
norm2(IComplexNDArray compute,
int dimension) |
static INDArray |
norm2(INDArray compute) |
static INDArray |
norm2(INDArray compute,
int dimension) |
static IComplexNDArray |
normmax(IComplexNDArray compute) |
static IComplexNDArray |
normmax(IComplexNDArray compute,
int dimension) |
static INDArray |
normmax(INDArray compute) |
static INDArray |
normmax(INDArray compute,
int dimension) |
static INDArray |
ones(int... shape)
Create an ndarray of ones
|
static INDArray |
ones(int columns)
Creates a row vector with the specified number of columns
|
static INDArray |
ones(int rows,
int columns)
Creates a row vector with the specified number of columns
|
static INDArray |
onesLike(INDArray arr)
Ones like
|
static Character |
order()
Returns the ordering of the ndarrays
|
static INDArray |
pad(INDArray toPad,
int[][] padWidth,
List<double[]> constantValues,
Nd4j.PadMode padMode)
Pad the given ndarray to the size along each dimension
|
static INDArray |
pad(INDArray toPad,
int[][] padWidth,
Nd4j.PadMode padMode)
Pad the given ndarray to the size along each dimension
|
static INDArray |
pad(INDArray toPad,
int[] padWidth,
List<double[]> constantValues,
Nd4j.PadMode padMode)
Pad the given ndarray to the size along each dimension
|
static INDArray |
pad(INDArray toPad,
int[] padWidth,
Nd4j.PadMode padMode)
Pad the given ndarray to the size along each dimension
|
static IComplexNumber |
parseComplexNumber(String val)
Parse a complex number
|
static INDArray |
prepend(INDArray arr,
int padAmount,
double val,
int axis)
Append the given
array with the specified value size
along a particular axis
|
static IComplexNDArray |
prod(IComplexNDArray compute) |
static IComplexNDArray |
prod(IComplexNDArray compute,
int dimension) |
static INDArray |
prod(INDArray compute) |
static INDArray |
prod(INDArray compute,
int dimension) |
static INDArray |
rand(int[] shape)
Create a random ndarray with the given shape using
the current time as the seed
|
static INDArray |
rand(int[] shape,
Distribution dist)
Create a random ndarray with the given shape using the given rng
|
static INDArray |
rand(int[] shape,
double min,
double max,
Random rng)
Generates a random matrix between min and max
|
static INDArray |
rand(int[] shape,
long seed)
Create a random ndarray with the given shape using given seed
|
static INDArray |
rand(int[] shape,
Random rng)
Create a random ndarray with the given shape using the given RandomGenerator
|
static INDArray |
rand(int rows,
int columns)
Create a random ndarray with the given shape using
the current time as the seed
|
static INDArray |
rand(int rows,
int columns,
double min,
double max,
Random rng)
Generates a random matrix between min and max
|
static INDArray |
rand(int rows,
int columns,
long seed)
Create a random ndarray with the given shape using the given seed
|
static INDArray |
rand(int rows,
int columns,
Random rng)
Deprecated.
|
static INDArray |
rand(long seed,
int... shape)
Create a random ndarray with the given shape using the given seed
|
static INDArray |
randn(int[] shape)
Random normal using the current time stamp
as the seed
|
static INDArray |
randn(int[] shape,
long seed)
Random normal using the specified seed
|
static INDArray |
randn(int[] shape,
Random r)
Random normal using the given rng
|
static INDArray |
randn(int rows,
int columns)
Random normal using the current time stamp
as the seed
|
static INDArray |
randn(int rows,
int columns,
long seed)
Random normal using the specified seed
|
static INDArray |
randn(int rows,
int columns,
Random r)
Random normal using the given rng
|
static INDArray |
read(DataInputStream dis)
Read in an ndarray from a data input stream
|
static INDArray |
read(InputStream reader)
Raad an ndarray from an input stream
|
static INDArray |
readBinary(File read)
Read a binary ndarray from the given file
|
static IComplexNDArray |
readComplex(DataInputStream dis)
Read in an ndarray from a data input stream
|
static INDArray |
readNumpy(InputStream filePath,
String split)
Read line via input streams
|
static INDArray |
readNumpy(String filePath)
Read line via input streams
|
static INDArray |
readNumpy(String filePath,
String split)
Read line via input streams
|
static INDArray |
readTxt(String filePath)
Read line via input streams
|
static ReferenceQueue<INDArray> |
refQueue()
The reference queue used for cleaning up
ndarrays
|
static IComplexNDArray |
repeat(IComplexNDArray n,
int num)
Create an n x (shape)
ndarray where the ndarray is repeated num times
|
static INDArray |
repeat(INDArray n,
int num)
Create an n x (shape)
ndarray where the ndarray is repeated num times
|
static INDArray |
reverse(INDArray reverse)
Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc
|
static INDArray |
rollAxis(INDArray a,
int axis)
Roll the specified axis backwards,
until it lies in a given position.
|
static INDArray |
rollAxis(INDArray a,
int axis,
int start)
Roll the specified axis backwards,
until it lies in a given position.
|
static INDArray |
rot(INDArray reverse)
Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc
|
static void |
rot90(INDArray toRotate)
Rotate a matrix 90 degrees
|
static void |
saveBinary(INDArray arr,
File saveTo)
Save an ndarray to the given file
|
static INDArray |
scalar(double value)
Create a scalar nd array with the specified value and offset
|
static INDArray |
scalar(double value,
int offset)
Create a scalar nd array with the specified value and offset
|
static INDArray |
scalar(float value)
Create a scalar nd array with the specified value and offset
|
static INDArray |
scalar(float value,
int offset)
Create a scalar nd array with the specified value and offset
|
static IComplexNDArray |
scalar(IComplexDouble value)
Create a scalar nd array with the specified value and offset
|
static IComplexNDArray |
scalar(IComplexDouble value,
int offset)
Create a scalar nd array with the specified value and offset
|
static IComplexNDArray |
scalar(IComplexFloat value)
Create a scalar nd array with the specified value and offset
|
static IComplexNDArray |
scalar(IComplexFloat value,
int offset)
Create a scalar nd array with the specified value and offset
|
static IComplexNDArray |
scalar(IComplexNumber value)
Create a scalar ndarray with the specified offset
|
static IComplexNDArray |
scalar(IComplexNumber value,
int offset)
Create a scalar ndarray with the specified offset
|
static INDArray |
scalar(Number value)
Create a scalar ndarray with the specified offset
|
static INDArray |
scalar(Number value,
int offset)
Create a scalar ndarray with the specified offset
|
static void |
setBlasWrapper(BlasWrapper factory)
Sets the global blas wrapper
|
static void |
setConvolution(ConvolutionInstance convolutionInstance)
Set a convolution instance
|
static void |
setFactory(NDArrayFactory factory) |
static void |
setFft(FFTInstance fftInstance) |
static void |
setNdArrayFactoryClazz(Class<? extends NDArrayFactory> clazz) |
static void |
setParams(INDArray theta,
Collection<INDArray>... matrices)
Given a sequence of Iterators over a transform of matrices, fill in all of
the matrices with the entries in the theta vector.
|
static void |
setParams(INDArray theta,
Iterator<? extends INDArray>... matrices)
Given a sequence of Iterators over a transform of matrices, fill in all of
the matrices with the entries in the theta vector.
|
static int[] |
shape(INDArray arr)
Returns the shape of the ndarray
|
static void |
shuffle(INDArray toShuffle,
int... dimension)
In place shuffle of an ndarray
along a specified set of dimensions
|
static void |
shuffle(INDArray toShuffle,
Random random,
int... dimension)
In place shuffle of an ndarray
along a specified set of dimensions
|
static IComplexNDArray |
sort(IComplexNDArray ndarray,
int dimension,
boolean ascending)
Sort an ndarray along a particular dimension
|
static INDArray |
sort(INDArray ndarray,
int dimension,
boolean ascending)
Sort an ndarray along a particular dimension
|
static INDArray |
sortColumns(INDArray in,
int rowIdx,
boolean ascending)
Sort (shuffle) the columns of a 2d array according to the value at a specified row.
|
static INDArray |
sortRows(INDArray in,
int colIdx,
boolean ascending)
Sort (shuffle) the rows of a 2d array according to the value at a specified column.
|
static INDArray[] |
sortWithIndices(IComplexNDArray ndarray,
int dimension,
boolean ascending)
Sort an ndarray along a particular dimension
|
static INDArray[] |
sortWithIndices(INDArray ndarray,
int dimension,
boolean ascending)
Sort an ndarray along a particular dimension
|
static IComplexNDArray |
std(IComplexNDArray compute) |
static IComplexNDArray |
std(IComplexNDArray compute,
int dimension) |
static INDArray |
std(INDArray compute) |
static INDArray |
std(INDArray compute,
int dimension) |
static INDArray |
stripOnes(INDArray toStrip)
Reshapes an ndarray to remove leading 1s
|
static IComplexNDArray |
sum(IComplexNDArray compute) |
static IComplexNDArray |
sum(IComplexNDArray compute,
int dimension) |
static INDArray |
sum(INDArray compute) |
static INDArray |
sum(INDArray compute,
int dimension) |
static INDArray |
tensorMmul(INDArray a,
INDArray b,
int[][] axes)
Tensor matrix multiplication.
|
static INDArray |
tile(INDArray tile,
int... repeat)
An alias for repmat
|
static byte[] |
toByteArray(INDArray arr)
Convert an ndarray to a byte array
|
static INDArray |
toFlattened(char order,
Collection<INDArray> matrices)
Create a long row vector of all of the given ndarrays
|
static INDArray |
toFlattened(char order,
INDArray... matrices)
Create a long row vector of all of the given ndarrays
|
static INDArray |
toFlattened(Collection<INDArray> matrices)
Create a long row vector of all of the given ndarrays
|
static INDArray |
toFlattened(INDArray... matrices)
Create a long row vector of all of the given ndarrays
|
static INDArray |
toFlattened(int length,
Iterator<? extends INDArray>... matrices)
Create a long row vector of all of the given ndarrays
|
static INDArray |
valueArrayOf(int[] shape,
double value)
Creates an ndarray with the specified value
as the only value in the ndarray
|
static INDArray |
valueArrayOf(int num,
double value)
Creates an ndarray with the specified value
as the only value in the ndarray
|
static INDArray |
valueArrayOf(int rows,
int columns,
double value)
Creates a row vector with the specified number of columns
|
static IComplexNDArray |
var(IComplexNDArray compute) |
static IComplexNDArray |
var(IComplexNDArray compute,
int dimension) |
static INDArray |
var(INDArray compute) |
static INDArray |
var(INDArray compute,
int dimension) |
static INDArray |
vstack(INDArray... arrs)
Concatenates two matrices vertically.
|
static void |
write(INDArray arr,
DataOutputStream dataOutputStream)
Write an ndarray to the specified outputstream
|
static void |
write(OutputStream writer,
INDArray write)
Write an ndarray to a writer
|
static void |
writeComplex(IComplexNDArray arr,
DataOutputStream dataOutputStream)
Write an ndarray to the specified outputs tream
|
static void |
writeNumpy(INDArray write,
String filePath,
String split)
Read line via input streams
|
static void |
writeTxt(INDArray write,
String filePath,
String split)
Read line via input streams
|
static INDArray |
zeros(int... shape)
Create an ndarray of zeros
|
static INDArray |
zeros(int columns)
Creates a row vector with the specified number of columns
|
static INDArray |
zeros(int rows,
int columns)
Creates a row vector with the specified number of columns
|
static INDArray |
zerosLike(INDArray arr)
Empty like
|
public static final String NUMERICAL_STABILITY
public static final String FFT_OPS
public static final String DATA_BUFFER_OPS
public static final String CONVOLUTION_OPS
public static final String DTYPE
public static final String BLAS_OPS
public static final String ORDER_KEY
public static final String NDARRAY_FACTORY_CLASS
public static final String COPY_OPS
public static final String OP_EXECUTIONER
public static final String OP_FACTORY
public static final String TASK_FACTORY
public static final String RANDOM
public static final String DISTRIBUTION
public static final String INSTRUMENTATION
public static final String RESOURCE_MANAGER
public static final String RESOURCE_MANGER_ON
public static final String ALLOC
public static final String EXECUTION_MODE
public static OpExecutioner.ExecutionMode executionMode
public static DataBuffer.Type dtype
public static DataBuffer.AllocationMode alloc
public static char ORDER
public static IComplexNumber UNIT
public static IComplexNumber ZERO
public static IComplexNumber NEG_UNIT
public static double EPS_THRESHOLD
public static int MAX_ELEMENTS_PER_SLICE
public static int MAX_SLICES_TO_PRINT
public static boolean ENFORCE_NUMERICAL_STABILITY
public static boolean copyOnOps
public static boolean shouldInstrument
public static boolean resourceManagerOn
protected static Class<? extends BlasWrapper> blasWrapperClazz
protected static Class<? extends NDArrayFactory> ndArrayFactoryClazz
protected static Class<? extends FFTInstance> fftInstanceClazz
protected static Class<? extends ConvolutionInstance> convolutionInstanceClazz
protected static Class<? extends DataBufferFactory> dataBufferFactoryClazz
protected static Class<? extends OpExecutioner> opExecutionerClazz
protected static Class<? extends TaskFactory> taskFactoryClazz
protected static Class<? extends DistributionFactory> distributionFactoryClazz
protected static Class<? extends Instrumentation> instrumentationClazz
protected static DataBufferFactory DATA_BUFFER_FACTORY_INSTANCE
protected static BlasWrapper BLAS_WRAPPER_INSTANCE
protected static NDArrayFactory INSTANCE
protected static FFTInstance FFT_INSTANCE
protected static ConvolutionInstance CONVOLUTION_INSTANCE
protected static OpExecutioner OP_EXECUTIONER_INSTANCE
protected static DistributionFactory DISTRIBUTION_FACTORY
protected static OpFactory OP_FACTORY_INSTANCE
protected static TaskFactory TASK_FACTORY_INSTANCE
protected static Random random
protected static Instrumentation instrumentation
protected static Properties props
protected static ReferenceQueue<INDArray> referenceQueue
protected static ReferenceQueue<DataBuffer> bufferQueue
public static INDArray pad(INDArray toPad, int[][] padWidth, Nd4j.PadMode padMode)
toPad
- the ndarray to padpadWidth
- the width to pad along each dimensionpadMode
- the mode to pad inpublic static INDArray pad(INDArray toPad, int[][] padWidth, List<double[]> constantValues, Nd4j.PadMode padMode)
toPad
- the ndarray to padpadWidth
- the width to pad along each dimensionconstantValues
- the values to append for each dimensionpadMode
- the mode to pad inpublic static INDArray pad(INDArray toPad, int[] padWidth, List<double[]> constantValues, Nd4j.PadMode padMode)
toPad
- the ndarray to padpadWidth
- the width to pad along each dimensionconstantValues
- the values to append for each dimensionpadMode
- the mode to pad inpublic static INDArray pad(INDArray toPad, int[] padWidth, Nd4j.PadMode padMode)
toPad
- the ndarray to padpadWidth
- the width to pad along each dimensionpadMode
- the mode to pad inpublic static INDArray append(INDArray arr, int padAmount, double val, int axis)
arr
- the array to append topadAmount
- the pad amount of the array to be returnedval
- the value to appendaxis
- the axis to append topublic static INDArray prepend(INDArray arr, int padAmount, double val, int axis)
arr
- the array to append topadAmount
- the pad amount of the array to be returnedval
- the value to appendaxis
- the axis to append topublic static void shuffle(INDArray toShuffle, Random random, int... dimension)
toShuffle
- the ndarray to shufflerandom
- the random to usedimension
- the dimension to do the shufflepublic static void shuffle(INDArray toShuffle, int... dimension)
toShuffle
- the ndarray to shuffledimension
- the dimension to do the shufflepublic static ReferenceQueue<INDArray> refQueue()
public static ReferenceQueue<DataBuffer> bufferRefQueue()
public static Instrumentation getInstrumentation()
public static DistributionFactory getDistributions()
public static void setNdArrayFactoryClazz(Class<? extends NDArrayFactory> clazz)
public static Random getRandom()
public static ConvolutionInstance getConvolution()
public static void setConvolution(ConvolutionInstance convolutionInstance)
convolutionInstance
- public static int[] shape(INDArray arr)
arr
- the array to get the shape ofpublic static INDArray create(int[] sliceShape, float[]... arrays)
sliceShape
- the shape of each slicearrays
- the arrays of data to createpublic static INDArray create(int[] sliceShape, double[]... arrays)
sliceShape
- the shape of each slicearrays
- the arrays of data to createpublic static OpExecutioner getExecutioner()
public static OpFactory getOpFactory()
public static TaskFactory getTaskFactory()
public static FFTInstance getFFt()
public static void setFft(FFTInstance fftInstance)
fftInstance
- public static void setParams(INDArray theta, Collection<INDArray>... matrices)
public static INDArray rollAxis(INDArray a, int axis)
a
- the array to rollaxis
- the axis to roll backwardspublic static INDArray argMax(INDArray arr, int... dimension)
arr
- dimension
- public static INDArray rollAxis(INDArray a, int axis, int start)
a
- the array to rollaxis
- the axis to roll backwardsstart
- the starting pointpublic static INDArray tensorMmul(INDArray a, INDArray b, int[][] axes)
a
- the left tensorb
- the right tensoraxes
- the axes for each array to do matrix multiply alongpublic static INDArray gemm(INDArray a, INDArray b, boolean transposeA, boolean transposeB)
a
- First matrixb
- Second matrixtransposeA
- if true: transpose matrix a before mmultransposeB
- if true: transpose matrix b before mmulpublic static INDArray gemm(INDArray a, INDArray b, INDArray c, boolean transposeA, boolean transposeB, double alpha, double beta)
a
- First matrixb
- Second matrixc
- result matrix. Used in calculation (assuming beta != 0) and result is stored in this. f order,
zero offset and length == data.length onlytransposeA
- if true: transpose matrix a before mmultransposeB
- if true: transpose matrix b before mmulpublic static void setParams(INDArray theta, Iterator<? extends INDArray>... matrices)
public static NDArrayFactory factory()
public static IComplexNDArray cumsum(IComplexNDArray compute)
public static IComplexNDArray max(IComplexNDArray compute)
public static IComplexNDArray min(IComplexNDArray compute)
public static IComplexNDArray prod(IComplexNDArray compute)
public static IComplexNDArray normmax(IComplexNDArray compute)
public static IComplexNDArray norm2(IComplexNDArray compute)
public static IComplexNDArray norm1(IComplexNDArray compute)
public static IComplexNDArray std(IComplexNDArray compute)
public static IComplexNDArray var(IComplexNDArray compute)
public static IComplexNDArray sum(IComplexNDArray compute)
public static IComplexNDArray mean(IComplexNDArray compute)
public static IComplexNDArray cumsum(IComplexNDArray compute, int dimension)
public static IComplexNDArray max(IComplexNDArray compute, int dimension)
public static IComplexNDArray min(IComplexNDArray compute, int dimension)
public static IComplexNDArray prod(IComplexNDArray compute, int dimension)
public static IComplexNDArray normmax(IComplexNDArray compute, int dimension)
public static IComplexNDArray norm2(IComplexNDArray compute, int dimension)
public static IComplexNDArray norm1(IComplexNDArray compute, int dimension)
public static IComplexNDArray std(IComplexNDArray compute, int dimension)
public static IComplexNDArray var(IComplexNDArray compute, int dimension)
public static IComplexNDArray sum(IComplexNDArray compute, int dimension)
public static IComplexNDArray mean(IComplexNDArray compute, int dimension)
public static DataBuffer createBuffer(int[] shape, DataBuffer.Type type)
shape
- the shape of the buffer to createtype
- the type to createpublic static DataBuffer createBuffer(byte[] data, int length)
data
- the data to create the buffer withpublic static DataBuffer createBuffer(int[] shape)
shape
- the shape of the buffer to createpublic static DataBuffer createBuffer(int length)
length
- the length of te bufferpublic static DataBuffer createBuffer(float[] data)
data
- the data to create the buffer withpublic static DataBuffer createBuffer(double[] data)
data
- the data to create the buffer withpublic static void setFactory(NDArrayFactory factory)
public static Character order()
public static DataBuffer.Type dataType()
public static BlasWrapper getBlasWrapper()
public static void setBlasWrapper(BlasWrapper factory)
factory
- public static IComplexNDArray repeat(IComplexNDArray n, int num)
n
- the ndarray to replicatenum
- the number of copies to repeatpublic static INDArray[] sortWithIndices(IComplexNDArray ndarray, int dimension, boolean ascending)
ndarray
- the ndarray to sortdimension
- the dimension to sortpublic static INDArray[] sortWithIndices(INDArray ndarray, int dimension, boolean ascending)
ndarray
- the ndarray to sortdimension
- the dimension to sortpublic static IComplexNDArray sort(IComplexNDArray ndarray, int dimension, boolean ascending)
ndarray
- the ndarray to sortdimension
- the dimension to sortpublic static INDArray sort(INDArray ndarray, int dimension, boolean ascending)
ndarray
- the ndarray to sortdimension
- the dimension to sortpublic static INDArray sortRows(INDArray in, int colIdx, boolean ascending)
in
- 2d array to sortcolIdx
- The column to sort onascending
- true if smallest-to-largest; false if largest-to-smallestpublic static INDArray sortColumns(INDArray in, int rowIdx, boolean ascending)
in
- 2d array to sortrowIdx
- The row to sort onascending
- true if smallest-to-largest; false if largest-to-smallestpublic static INDArray repeat(INDArray n, int num)
n
- the ndarray to replicatenum
- the number of copies to repeatpublic static INDArray linspace(int lower, int upper, int num)
lower
- upper boundupper
- lower boundnum
- the step sizepublic static INDArray toFlattened(Collection<INDArray> matrices)
matrices
- the matrices to create the flattened ndarray forpublic static INDArray toFlattened(char order, Collection<INDArray> matrices)
order
- the order in which to flatten the matricesmatrices
- the matrices to create the flattened ndarray forpublic static IComplexNDArray complexFlatten(List<IComplexNDArray> flatten)
flatten
- the matrices to create the flattened ndarray forpublic static IComplexNDArray complexFlatten(IComplexNDArray... flatten)
flatten
- the matrices to create the flattened ndarray forpublic static INDArray toFlattened(int length, Iterator<? extends INDArray>... matrices)
matrices
- the matrices to create the flattened ndarray forpublic static INDArray bilinearProducts(INDArray curr, INDArray in)
public static INDArray toFlattened(INDArray... matrices)
matrices
- the matrices to create the flattened ndarray forpublic static INDArray toFlattened(char order, INDArray... matrices)
order
- order in which to flatten ndarraysmatrices
- the matrices to create the flattened ndarray forpublic static INDArray eye(int n)
n
- the number for the identitypublic static void rot90(INDArray toRotate)
toRotate
- the matrix to rotatepublic static void writeTxt(INDArray write, String filePath, String split) throws IOException
filePath
- the input stream ndarraysplit
- the split separatorIOException
public static void write(OutputStream writer, INDArray write) throws IOException
writer
- the writer to write towrite
- the ndarray to writeIOException
public static byte[] toByteArray(INDArray arr) throws IOException
arr
- the array to convertIOException
public static INDArray fromByteArray(byte[] arr) throws IOException
arr
- the array to read fromIOException
public static INDArray readNumpy(InputStream filePath, String split) throws IOException
filePath
- the input stream ndarraysplit
- the split separatorIOException
public static void writeNumpy(INDArray write, String filePath, String split) throws IOException
filePath
- the input stream ndarraysplit
- the split separatorIOException
public static INDArray readNumpy(String filePath, String split) throws IOException
filePath
- the input stream ndarraysplit
- the split separatorIOException
public static INDArray readNumpy(String filePath) throws IOException
filePath
- the input stream ndarrayIOException
public static INDArray read(InputStream reader) throws IOException
reader
- the input stream to useIOException
public static IComplexNumber parseComplexNumber(String val)
val
- the string to parsepublic static INDArray readTxt(String filePath) throws IOException
filePath
- the input stream ndarrayIOException
public static INDArray read(DataInputStream dis) throws IOException
dis
- the data input stream to read fromIOException
public static void write(INDArray arr, DataOutputStream dataOutputStream) throws IOException
arr
- the array to writedataOutputStream
- the data output stream to write toIOException
public static void saveBinary(INDArray arr, File saveTo) throws IOException
arr
- the array to savesaveTo
- the file to save toIOException
public static INDArray readBinary(File read) throws IOException
read
- the nd array to readIOException
public static void clearNans(INDArray arr)
arr
- the array to clearpublic static IComplexNDArray readComplex(DataInputStream dis) throws IOException
dis
- the data input stream to read fromIOException
public static void writeComplex(IComplexNDArray arr, DataOutputStream dataOutputStream) throws IOException
arr
- the array to writedataOutputStream
- the data output stream to write toIOException
public static INDArray rot(INDArray reverse)
reverse
- the matrix to reversepublic static INDArray reverse(INDArray reverse)
reverse
- the matrix to reversepublic static INDArray arange(double begin, double end)
begin
- the begin of the rangeend
- the end of the rangepublic static INDArray arange(double end)
end
- the end of the rangepublic static IComplexFloat createFloat(float real, float imag)
real
- real componentimag
- imag componentpublic static IComplexDouble createDouble(double real, double imag)
real
- the real componentimag
- the imaginary componentpublic static void copy(INDArray a, INDArray b)
a
- the origin matrixb
- the destination matrixpublic static IComplexNDArray diag(IComplexNDArray x, int k)
x
- the diagonal valuesk
- the kth diagonal to getDoublepublic static INDArray diag(INDArray x, int k)
x
- the diagonal valuesk
- the kth diagonal to getDoublepublic static IComplexNDArray diag(IComplexNDArray x)
x
- the diagonal valuespublic static INDArray diag(INDArray x)
x
- the diagonal valuespublic static void doAlongDiagonal(INDArray x, com.google.common.base.Function<Number,Number> func)
x
- the ndarray to perform the operation onfunc
- the operation to performpublic static void doAlongDiagonal(IComplexNDArray x, com.google.common.base.Function<IComplexNumber,IComplexNumber> func)
x
- the ndarray to perform the operation onfunc
- the operation to performpublic static INDArray rand(int[] shape)
shape
- the shape of the ndarraypublic static IComplexNDArray complexRand(int... shape)
shape
- the shape of the ndarraypublic static INDArray rand(int rows, int columns)
rows
- the number of rows in the matrixcolumns
- the number of columns in the matrixpublic static INDArray rand(int[] shape, long seed)
shape
- the shape of the ndarrayseed
- the seed to usepublic static INDArray rand(long seed, int... shape)
seed
- the seedshape
- the shapepublic static INDArray rand(int rows, int columns, long seed)
rows
- the number of rows in the matrixcolumns
- the columns of the ndarrayseed
- the seed to usepublic static INDArray rand(int[] shape, Random rng)
shape
- the shape of the ndarrayrng
- the random generator to usepublic static INDArray rand(int[] shape, Distribution dist)
shape
- the shape of the ndarraydist
- distribution to use@Deprecated public static INDArray rand(int rows, int columns, Random rng)
rows
- the number of rows in the matrixcolumns
- the number of columns in the matrixrng
- the random generator to usepublic static INDArray rand(int[] shape, double min, double max, Random rng)
shape
- the number of rows of the matrixmin
- the minimum numbermax
- the maximum numberrng
- the rng to usepublic static INDArray rand(int rows, int columns, double min, double max, Random rng)
rows
- the number of rows of the matrixcolumns
- the number of columns in the matrixmin
- the minimum numbermax
- the maximum numberrng
- the rng to usepublic static INDArray randn(int[] shape)
shape
- the shape of the ndarraypublic static INDArray randn(int[] shape, long seed)
shape
- the shape of the ndarraypublic static INDArray randn(int rows, int columns)
rows
- the number of rows in the matrixcolumns
- the number of columns in the matrixpublic static INDArray randn(int rows, int columns, long seed)
rows
- the number of rows in the matrixcolumns
- the number of columns in the matrixpublic static INDArray randn(int rows, int columns, Random r)
rows
- the number of rows in the matrixcolumns
- the number of columns in the matrixr
- the random generator to usepublic static INDArray randn(int[] shape, Random r)
shape
- the shape of the ndarrayr
- the random generator to usepublic static INDArray create(float[] data)
data
- the columns of the ndarraypublic static IComplexNDArray createComplex(float[] data)
data
- the number of columns in the row vectorpublic static INDArray create(double[] data)
data
- the columns of the ndarraypublic static INDArray create(float[][] data)
data
- public static INDArray create(float[][] data, char ordering)
data
- ordering
- public static INDArray create(double[][] data)
data
- the data to usepublic static INDArray create(double[][] data, char ordering)
data
- ordering
- public static IComplexNDArray createComplex(INDArray arr)
arr
- the arr to wrappublic static INDArray create(int columns)
columns
- the columns of the ndarraypublic static IComplexNDArray createComplex(int columns)
columns
- the number of columns in the row vectorpublic static IComplexNumber createComplexNumber(Number real, Number imag)
real
- real componentimag
- imag componentpublic static IComplexNDArray createComplex(INDArray real, INDArray imag)
real
- the real numbersimag
- the imaginary componentspublic static IComplexNDArray createComplex(IComplexNumber[] data, int[] shape)
data
- the data to wrappublic static IComplexNDArray createComplex(List<IComplexNDArray> arrs, int[] shape)
arrs
- the arr to wrappublic static INDArray create(float[] data, char order)
data
- the columns of the ndarraypublic static INDArray create(double[] data, char order)
data
- the columns of the ndarraypublic static IComplexNDArray createComplex(double[] data, char order)
data
- the number of columns in the row vectorpublic static INDArray create(int columns, char order)
columns
- the columns of the ndarraypublic static IComplexNDArray createComplex(int columns, char order)
columns
- the number of columns in the row vectorpublic static IComplexNDArray createComplex(IComplexNumber[] data, int[] shape, int offset, char order)
data
- the data to wrappublic static INDArray create(float[] data, int[] shape)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraypublic static IComplexNDArray createComplex(float[] data, int[] shape)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraypublic static INDArray create(double[] data, int[] shape)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraypublic static IComplexNDArray createComplex(double[] data, int[] shape)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraypublic static IComplexNDArray createComplex(float[] data, int[] shape, int[] stride)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraystride
- the stride for the ndarraypublic static IComplexNDArray createComplex(double[] data, int[] shape, int[] stride)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraystride
- the stride for the ndarraypublic static IComplexNDArray createComplex(float[] data, int[] shape, int[] stride, int offset)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(double[] data, int[] shape, int[] stride, int offset)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static IComplexNDArray createComplex(double[] data, int[] shape, int[] stride, int offset)
data
- the data to use with the ndarrayshape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(float[] data, int rows, int columns, int[] stride, int offset)
data
- the data to use with the ndarrayrows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static IComplexNDArray createComplex(float[] data, int rows, int columns, int[] stride, int offset)
data
- the data to use with the ndarrayrows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(double[] data, int rows, int columns, int[] stride, int offset)
data
- the data to use with tne ndarrayrows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static IComplexNDArray createComplex(double[] data, int rows, int columns, int[] stride, int offset)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(float[] data, int[] shape, int offset)
shape
- the shape of the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(double[] data, int[] shape, int offset, char ordering)
shape
- the shape of the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(float[] data, int[] shape, int[] stride, int offset)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(List<INDArray> list, int[] shape)
shape
- the shape of the ndarraypublic static IComplexNDArray createComplex(int rows, int columns, int[] stride, int offset)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(int rows, int columns, int[] stride, int offset)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static IComplexNDArray createComplex(int[] shape, int[] stride, int offset)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(int[] shape, int[] stride, int offset)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static IComplexNDArray createComplex(int rows, int columns, int[] stride)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarraypublic static INDArray create(int rows, int columns, int[] stride)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarraypublic static IComplexNDArray createComplex(int[] shape, int[] stride)
shape
- the shape of the ndarraystride
- the stride for the ndarraypublic static INDArray create(int[] shape, int[] stride)
shape
- the shape of the ndarraystride
- the stride for the ndarraypublic static IComplexNDArray createComplex(int rows, int columns)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraypublic static INDArray create(int rows, int columns)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraypublic static IComplexNDArray createComplex(int... shape)
shape
- the shape of the ndarraypublic static INDArray create(int... shape)
shape
- the shape of the ndarraypublic static INDArray create(float[] data, int[] shape, int[] stride, char ordering, int offset)
data
- shape
- stride
- ordering
- offset
- public static INDArray create(float[] data, int[] shape, char ordering, int offset)
data
- shape
- ordering
- offset
- public static INDArray create(DataBuffer data, int[] shape, int[] strides, int offset)
data
- shape
- strides
- offset
- public static INDArray create(DataBuffer data, int[] shape, int offset)
data
- shape
- offset
- public static INDArray create(DataBuffer data, int[] newShape, int[] newStride, int offset, char ordering)
data
- newShape
- newStride
- offset
- ordering
- public static IComplexNDArray createComplex(DataBuffer data, int[] shape, int[] newStrides, int offset)
data
- shape
- newStrides
- offset
- public static IComplexNDArray createComplex(DataBuffer data, int[] shape, int offset)
data
- shape
- offset
- public static IComplexNDArray createComplex(DataBuffer data, int[] shape, int[] newStrides, int offset, char ordering)
data
- shape
- newStrides
- offset
- ordering
- public static IComplexNDArray createComplex(DataBuffer data, int[] shape, int offset, char ordering)
data
- shape
- offset
- ordering
- public static INDArray create(DataBuffer data, int[] shape)
data
- shape
- public static IComplexNDArray createComplex(DataBuffer data, int[] shape)
data
- shape
- public static INDArray create(DataBuffer buffer)
buffer
- public static IComplexNDArray createComplex(IComplexNumber[] iComplexNumbers)
iComplexNumbers
- the numbers to usepublic static IComplexNDArray createComplex(IComplexNumber[][] iComplexNumbers)
iComplexNumbers
- the complex numberspublic static IComplexNDArray createComplex(float[] data, int rows, int columns, int[] stride, int offset, char ordering)
data
- the data to use with the ndarrayrows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(float[] data, int rows, int columns, int[] stride, int offset, char ordering)
data
- the data to use with the ndarrayrows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(int[] shape, DataBuffer.Type dataType)
public static IComplexNDArray createComplex(float[] data, int[] shape, int[] stride, int offset, char ordering)
data
- the data to use with the ndarrayshape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(double[] data, int[] shape, int[] stride, int offset, char ordering)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(double[] data, int[] shape, char ordering)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraypublic static INDArray create(float[] data, int[] shape, char ordering)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraypublic static IComplexNDArray createComplex(float[] data, int[] shape, char ordering)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraypublic static IComplexNDArray createComplex(double[] data, int[] shape, char ordering)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraypublic static IComplexNDArray createComplex(float[] data, int[] shape, int[] stride, char ordering)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraystride
- the stride for the ndarraypublic static IComplexNDArray createComplex(double[] data, int[] shape, int[] stride, char ordering)
data
- the data to use with tne ndarrayshape
- the shape of the ndarraystride
- the stride for the ndarraypublic static IComplexNDArray createComplex(double[] data, int rows, int columns, int[] stride, int offset, char ordering)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(double[] data, int rows, int columns, int[] stride, int offset, char ordering)
data
- the data to use with tne ndarrayrows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static IComplexNDArray createComplex(double[] data, int[] shape, int[] stride, int offset, char ordering)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(float[] data, int[] shape, int[] stride, int offset, char ordering)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(List<INDArray> list, int[] shape, char ordering)
shape
- the shape of the ndarraypublic static IComplexNDArray createComplex(int rows, int columns, int[] stride, int offset, char ordering)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(int rows, int columns, int[] stride, int offset, char ordering)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static IComplexNDArray createComplex(int[] shape, int[] stride, int offset, char ordering)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static INDArray create(int[] shape, int[] stride, int offset, char ordering)
shape
- the shape of the ndarraystride
- the stride for the ndarrayoffset
- the offset of the ndarraypublic static IComplexNDArray createComplex(int rows, int columns, int[] stride, char ordering)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarraypublic static INDArray create(int rows, int columns, int[] stride, char ordering)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraystride
- the stride for the ndarraypublic static IComplexNDArray createComplex(int[] shape, int[] stride, char ordering)
shape
- the shape of the ndarraystride
- the stride for the ndarraypublic static INDArray create(int[] shape, int[] stride, char ordering)
shape
- the shape of the ndarraystride
- the stride for the ndarraypublic static IComplexNDArray createComplex(int rows, int columns, char ordering)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraypublic static INDArray create(int rows, int columns, char ordering)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraypublic static IComplexNDArray createComplex(int[] shape, char ordering)
shape
- the shape of the ndarraypublic static INDArray create(int[] shape, char ordering)
shape
- the shape of the ndarraypublic static IComplexNDArray createComplex(float[] data, int[] shape, int offset, char ordering)
data
- shape
- offset
- ordering
- public static IComplexNDArray createComplex(double[] data, int[] shape, int offset)
data
- shape
- offset
- public static INDArray create(double[] data, int[] shape, int offset)
data
- shape
- offset
- public static IComplexNDArray createComplex(double[] data, int[] shape, int offset, char ordering)
data
- shape
- offset
- ordering
- public static IComplexNDArray createComplex(double[] dim)
dim
- public static IComplexNDArray createComplex(float[] data, int[] shape, int offset)
data
- shape
- offset
- public static boolean hasInvalidNumber(INDArray num)
num
- the ndarray to testpublic static INDArray zeros(int rows, int columns)
rows
- the rows of the ndarraycolumns
- the columns of the ndarraypublic static INDArray complexZeros(int rows, int columns)
rows
- te number of rows in the matrixcolumns
- the number of columns in the row vectorpublic static INDArray zeros(int columns)
columns
- the columns of the ndarraypublic static IComplexNDArray complexZeros(int columns)
columns
- the number of columns in the row vectorpublic static IComplexNDArray complexValueOf(int num, IComplexNumber value)
public static IComplexNDArray complexValueOf(int[] shape, IComplexNumber value)
public static IComplexNDArray complexValueOf(int num, double value)
public static IComplexNDArray complexValueOf(int[] shape, double value)
public static INDArray valueArrayOf(int[] shape, double value)
shape
- the shape of the ndarrayvalue
- the value to assignpublic static INDArray valueArrayOf(int num, double value)
num
- number of columnsvalue
- the value to assignpublic static INDArray valueArrayOf(int rows, int columns, double value)
rows
- the number of rows in the matrixcolumns
- the columns of the ndarrayvalue
- the value to assignpublic static INDArray ones(int rows, int columns)
rows
- the number of rows in the matrixcolumns
- the columns of the ndarraypublic static INDArray zerosLike(INDArray arr)
arr
- the array to create the ones likepublic static INDArray emptyLike(INDArray arr)
arr
- the array to create the ones likepublic static INDArray onesLike(INDArray arr)
arr
- the array to create the ones likepublic static IComplexNDArray complexOnes(int rows, int columns)
rows
- the number of rows in the matrixcolumns
- the number of columns in the row vectorpublic static INDArray ones(int columns)
columns
- the columns of the ndarraypublic static IComplexNDArray complexOnes(int columns)
columns
- the number of columns in the row vectorpublic static INDArray hstack(INDArray... arrs)
arrs
- the first matrix to concatpublic static INDArray vstack(INDArray... arrs)
arrs
- public static INDArray stripOnes(INDArray toStrip)
toStrip
- the ndarray to newShapeNoCopypublic static INDArray concat(int dimension, INDArray... toConcat)
dimension
- the dimension to concatnte alongtoConcat
- the ndarrays to concatpublic static IComplexNDArray concat(int dimension, IComplexNDArray... toConcat)
dimension
- the dimension to concatneate alongtoConcat
- the ndarrays to concatpublic static INDArray zeros(int... shape)
shape
- the shape of the ndarraypublic static IComplexNDArray complexZeros(int... shape)
shape
- the shape of the ndarraypublic static INDArray ones(int... shape)
shape
- the shape of the ndarraypublic static IComplexNDArray complexOnes(int... shape)
shape
- the shape of the ndarraypublic static INDArray scalar(Number value, int offset)
value
- the value to initialize the scalar withoffset
- the offset of the ndarraypublic static IComplexNDArray complexScalar(Number value, int offset)
value
- the value to initialize the scalar withoffset
- the offset of the ndarraypublic static IComplexNDArray complexScalar(Number value)
value
- the value to initialize the scalar withpublic static INDArray scalar(double value, int offset)
value
- the value of the scalaroffset
- the offset of the ndarraypublic static INDArray scalar(float value, int offset)
value
- the value of the scalaroffset
- the offset of the ndarraypublic static INDArray scalar(Number value)
value
- the value to initialize the scalar withpublic static INDArray scalar(double value)
value
- the value of the scalar
= * @return the scalar nd arraypublic static INDArray scalar(float value)
value
- the value of the scalar
= * @return the scalar nd arraypublic static IComplexNDArray scalar(IComplexNumber value, int offset)
value
- the value to initialize the scalar withoffset
- the offset of the ndarraypublic static IComplexNDArray scalar(IComplexFloat value)
value
- the value of the scalarpublic static IComplexNDArray scalar(IComplexDouble value)
value
- the value of the scalar
= * @return the scalar nd arraypublic static IComplexNDArray scalar(IComplexNumber value)
value
- the value to initialize the scalar withpublic static IComplexNDArray scalar(IComplexFloat value, int offset)
value
- the value of the scalaroffset
- the offset of the ndarraypublic static IComplexNDArray scalar(IComplexDouble value, int offset)
value
- the value of the scalaroffset
- the offset of the ndarraypublic static int[] getStrides(int[] shape, char order)
shape
- the shape of the ndarrayorder
- the order to getScalar the strides forpublic static int[] getStrides(int[] shape)
shape
- the shape of the ndarraypublic static INDArray tile(INDArray tile, int... repeat)
tile
- the ndarray to tilerepeat
- the shape to repeatpublic static int[] getComplexStrides(int[] shape, char order)
shape
- the shape of the ndarrayorder
- the order to getScalar the strides forpublic static int[] getComplexStrides(int[] shape)
shape
- the shape of the ndarraypublic static IComplexNDArray complexLinSpace(int i, int i1, int i2)
i
- i1
- i2
- public void initContext()
public void initWithBackend(Nd4jBackend backend)
backend
- the backend to initialize withCopyright © 2015. All Rights Reserved.