org.nd4j.linalg.factory
Class Nd4j
- java.lang.Object
-
- org.nd4j.linalg.factory.Nd4j
-
public class Nd4j extends java.lang.ObjectCreation of ndarrays via classpath discovery.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringBLAS_OPSstatic java.lang.StringCOMPLEX_CLASS_PROPstatic java.lang.Stringdtypestatic java.lang.StringDTYPEstatic doubleEPS_THRESHOLDstatic java.lang.StringLINALG_PROPSstatic intMAX_ELEMENTS_PER_SLICEstatic intMAX_SLICES_TO_PRINTstatic java.lang.StringNDARRAY_FACTORY_CLASSstatic IComplexNumberNEG_UNITstatic charORDERstatic java.lang.StringORDER_KEYstatic java.lang.StringREAL_CLASS_PROPstatic IComplexNumberUNITstatic IComplexNumberZERO
-
Constructor Summary
Constructors Constructor and Description Nd4j()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static INDArrayappendBias(INDArray... vectors)static INDArrayarange(double begin, double end)Array of evenly spaced values.static INDArraybilinearProducts(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 IComplexNDArraycomplexFlatten(IComplexNDArray... flatten)static IComplexNDArraycomplexFlatten(java.util.List<IComplexNDArray> flatten)static IComplexNDArraycomplexLinSpace(int i, int i1, int i2)static IComplexNDArraycomplexOnes(int columns)Creates an ndarraystatic IComplexNDArraycomplexOnes(int[] shape)Create an ndarray of onesstatic INDArraycomplexOnes(int rows, int columns)Creates an ndarraystatic IComplexNDArraycomplexScalar(java.lang.Number value)Create a scalar ndarray with the specified offsetstatic IComplexNDArraycomplexScalar(java.lang.Number value, int offset)Create a scalar ndarray with the specified offsetstatic IComplexNDArraycomplexValueOf(int[] shape, double value)static IComplexNDArraycomplexValueOf(int[] shape, IComplexNumber value)static IComplexNDArraycomplexValueOf(int num, double value)static IComplexNDArraycomplexValueOf(int num, IComplexNumber value)static INDArraycomplexZeros(int columns)Creates an ndarraystatic IComplexNDArraycomplexZeros(int[] shape)Create an ndarray of onesstatic INDArraycomplexZeros(int rows, int columns)Creates a matrix of zerosstatic IComplexNDArrayconcat(int dimension, IComplexNDArray... toConcat)Concatneate ndarrays along a dimensionstatic INDArrayconcat(int dimension, INDArray... toConcat)Concatneate ndarrays along a dimensionstatic voidcopy(INDArray a, INDArray b)Copy a to bstatic INDArraycreate(DataBuffer buffer)static INDArraycreate(DataBuffer data, int[] shape)static INDArraycreate(DataBuffer data, int[] shape, int offset)static INDArraycreate(DataBuffer data, int[] shape, int[] strides, int offset)static INDArraycreate(DataBuffer data, int[] newShape, int[] newStride, int offset, char ordering)static INDArraycreate(double[] data)Creates a row vector with the datastatic INDArraycreate(double[][] data)Create an ndarray based on the given data layoutstatic INDArraycreate(double[] data, char order)Creates a row vector with the datastatic INDArraycreate(double[] data, int[] shape)Create an ndrray with the specified shapestatic INDArraycreate(double[] data, int[] shape, char ordering)Create an ndrray with the specified shapestatic INDArraycreate(double[] data, int[] shape, int offset)static INDArraycreate(double[] data, int[] shape, int[] stride, int offset)Creates an ndarray with the specified shapestatic INDArraycreate(double[] data, int[] shape, int[] stride, int offset, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(double[] data, int[] shape, int offset, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(double[] data, int rows, int columns, int[] stride, int offset)Creates an ndarray with the specified shapestatic INDArraycreate(double[] data, int rows, int columns, int[] stride, int offset, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(float[] data)Creates a row vector with the datastatic INDArraycreate(float[][] doubles)static INDArraycreate(float[] data, char order)Creates a row vector with the datastatic INDArraycreate(float[] data, int[] shape)Create an ndrray with the specified shapestatic INDArraycreate(float[] data, int[] shape, char ordering)Create an ndrray with the specified shapestatic INDArraycreate(float[] data, int[] shape, char ordering, int offset)static INDArraycreate(float[] data, int[] shape, int offset)Creates an ndarray with the specified shapestatic INDArraycreate(float[] data, int[] shape, int[] stride, char ordering, int offset)static INDArraycreate(float[] data, int[] shape, int[] stride, int offset)Creates an ndarray with the specified shapestatic INDArraycreate(float[] data, int[] shape, int[] stride, int offset, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(float[] data, int rows, int columns, int[] stride, int offset)Creates an ndarray with the specified shapestatic INDArraycreate(float[] data, int rows, int columns, int[] stride, int offset, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(int columns)Creates a row vector with the specified number of columnsstatic INDArraycreate(int[] shape)Creates an ndarray with the specified shapestatic INDArraycreate(int[] shape, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(int[] shape, int[] stride)Creates an ndarray with the specified shapestatic INDArraycreate(int[] shape, int[] stride, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(int[] shape, int[] stride, int offset)Creates an ndarray with the specified shapestatic INDArraycreate(int[] shape, int[] stride, int offset, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(int columns, char order)Creates a row vector with the specified number of columnsstatic INDArraycreate(int rows, int columns)Creates an ndarray with the specified shapestatic INDArraycreate(int rows, int columns, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(int rows, int columns, int[] stride)Creates an ndarray with the specified shapestatic INDArraycreate(int rows, int columns, int[] stride, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(int rows, int columns, int[] stride, int offset)Creates an ndarray with the specified shapestatic INDArraycreate(int rows, int columns, int[] stride, int offset, char ordering)Creates an ndarray with the specified shapestatic INDArraycreate(java.util.List<INDArray> list, int[] shape)Creates an ndarray with the specified shapestatic INDArraycreate(java.util.List<INDArray> list, int[] shape, char ordering)Creates an ndarray with the specified shapestatic DataBuffercreateBuffer(double[] data)static <E> DataBuffercreateBuffer(E[] data)static DataBuffercreateBuffer(float[] data)static DataBuffercreateBuffer(int[] shape)Create a buffer equal of length prod(shape)static DataBuffercreateBuffer(long length)Creates a buffer of the specified length based on the data typestatic IComplexNDArraycreateComplex(DataBuffer data, int[] shape)static IComplexNDArraycreateComplex(DataBuffer data, int[] shape, int offset)static IComplexNDArraycreateComplex(DataBuffer data, int[] newShape, int[] newStrides, int offset)static IComplexNDArraycreateComplex(DataBuffer data, int[] newDims, int[] newStrides, int offset, char ordering)static IComplexNDArraycreateComplex(DataBuffer data, int[] shape, int offset, char ordering)static IComplexNDArraycreateComplex(double[] dim)static IComplexNDArraycreateComplex(double[] data, char order)Creates an ndarray with the specified datastatic IComplexNDArraycreateComplex(double[] data, int[] shape)Create an ndrray with the specified shapestatic IComplexNDArraycreateComplex(double[] data, int[] shape, char ordering)Create an ndrray with the specified shapestatic IComplexNDArraycreateComplex(double[] data, int[] shape, int offset)static IComplexNDArraycreateComplex(double[] data, int[] shape, int[] stride)Create an ndrray with the specified shapestatic IComplexNDArraycreateComplex(double[] data, int[] shape, int[] stride, char ordering)Create an ndrray with the specified shapestatic IComplexNDArraycreateComplex(double[] data, int[] shape, int[] stride, int offset)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(double[] data, int[] shape, int[] stride, int offset, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(double[] data, int[] ints, int offset, char ordering)static IComplexNDArraycreateComplex(double[] data, int rows, int columns, int[] stride, int offset)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(double[] data, int rows, int columns, int[] stride, int offset, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(float[] data)Creates an ndarray with the specified datastatic IComplexNDArraycreateComplex(float[] data, int[] shape)Create an ndrray with the specified shapestatic IComplexNDArraycreateComplex(float[] data, int[] shape, char ordering)Create an ndrray with the specified shapestatic IComplexNDArraycreateComplex(float[] data, int[] shape, int offset)static IComplexNDArraycreateComplex(float[] data, int[] shape, int[] stride)Create an ndrray with the specified shapestatic IComplexNDArraycreateComplex(float[] data, int[] shape, int[] stride, char ordering)Create an ndrray with the specified shapestatic IComplexNDArraycreateComplex(float[] data, int[] shape, int[] stride, int offset)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(float[] data, int[] shape, int[] stride, int offset, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(float[] data, int[] ints, int offset, char ordering)static IComplexNDArraycreateComplex(float[] data, int rows, int columns, int[] stride, int offset)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(float[] data, int rows, int columns, int[] stride, int offset, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(IComplexNumber[] data, int[] shape)Create a complex ndarray from the passed in indarraystatic IComplexNDArraycreateComplex(IComplexNumber[] data, int[] shape, int offset, char ordering)Create a complex ndarray from the passed in indarraystatic IComplexNDArraycreateComplex(INDArray arr)Create a complex ndarray from the passed in indarraystatic IComplexNDArraycreateComplex(INDArray real, INDArray imag)Create a complex ndarray based on the real and imaginarystatic IComplexNDArraycreateComplex(int columns)Creates an ndarraystatic IComplexNDArraycreateComplex(int[] shape)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int[] shape, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int[] shape, int[] stride)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int[] shape, int[] stride, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int[] shape, int[] stride, int offset)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int[] shape, int[] stride, int offset, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int columns, char order)Creates an ndarraystatic IComplexNDArraycreateComplex(int rows, int columns)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int rows, int columns, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int rows, int columns, int[] stride)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int rows, int columns, int[] stride, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int rows, int columns, int[] stride, int offset)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(int rows, int columns, int[] stride, int offset, char ordering)Creates a complex ndarray with the specified shapestatic IComplexNDArraycreateComplex(java.util.List<IComplexNDArray> arrs, int[] shape)Create a complex ndarray from the passed in indarraystatic IComplexFloatcreateComplexNumber(java.lang.Number real, java.lang.Number imag)Create doublestatic IComplexDoublecreateDouble(double real, double imag)Create an instance of a complex doublestatic IComplexFloatcreateFloat(float real, float imag)Create doublestatic java.lang.StringdataType()Returns the data type used for the runtimestatic IComplexNDArraydiag(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 matrixstatic IComplexNDArraydiag(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 matrixstatic INDArraydiag(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 matrixstatic INDArraydiag(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 matrixstatic voiddoAlongDiagonal(IComplexNDArray x, Function<IComplexNumber,IComplexNumber> func)Perform an operation along a diagonalstatic voiddoAlongDiagonal(INDArray x, Function<java.lang.Number,java.lang.Number> func)Perform an operation along a diagonalstatic INDArrayeye(int n)Create the identity ndarraystatic NDArrayFactoryfactory()static BlasWrappergetBlasWrapper()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 shapestatic 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 shapestatic booleanhasInvalidNumber(INDArray num)Returns true if the given ndarray has either an infinite or nanstatic INDArrayhstack(INDArray... arrs)Concatenates two matrices horizontally.static INDArraylinspace(int lower, int upper, int num)Generate a linearly spaced vectorstatic INDArrayones(int columns)Creates a row vector with the specified number of columnsstatic INDArrayones(int[] shape)Create an ndarray of onesstatic INDArrayones(int rows, int columns)Creates a row vector with the specified number of columnsstatic java.lang.Characterorder()Returns the ordering of the ndarraysstatic INDArrayrand(int[] shape)Create a random ndarray with the given shape using the current time as the seedstatic INDArrayrand(int[] shape, double min, double max, RandomGenerator rng)Generates a random matrix between min and maxstatic INDArrayrand(int[] shape, long seed)Create a random ndarray with the given shape using the given rngstatic INDArrayrand(int[] shape, RandomGenerator r)Create a random ndarray with the given shape using the given rngstatic INDArrayrand(int[] shape, RealDistribution r)Create a random ndarray with the given shape using the given rngstatic INDArrayrand(int rows, int columns)Create a random ndarray with the given shape using the current time as the seedstatic INDArrayrand(int rows, int columns, double min, double max, RandomGenerator rng)Generates a random matrix between min and maxstatic INDArrayrand(int rows, int columns, long seed)Create a random ndarray with the given shape using the given rngstatic INDArrayrand(int rows, int columns, RandomGenerator r)Create a random ndarray with the given shape using the given rngstatic INDArrayrandn(int[] shape)Random normal using the current time stamp as the seedstatic INDArrayrandn(int[] shape, long seed)Random normal using the specified seedstatic INDArrayrandn(int[] shape, RandomGenerator r)Random normal using the given rngstatic INDArrayrandn(int rows, int columns)Random normal using the current time stamp as the seedstatic INDArrayrandn(int rows, int columns, long seed)Random normal using the specified seedstatic INDArrayrandn(int rows, int columns, RandomGenerator r)Random normal using the given rngstatic INDArrayread(java.io.DataInputStream dis)Read in an ndarray from a data input streamstatic IComplexNDArrayreadComplex(java.io.DataInputStream dis)Read in an ndarray from a data input streamstatic INDArrayreadTxt(java.lang.String filePath)Read line via input streamsstatic INDArrayreadTxt(java.lang.String filePath, java.lang.String split)Read line via input streamsstatic IComplexNDArrayrepeat(IComplexNDArray n, int num)Create an n x (shape) ndarray where the ndarray is repeated num timesstatic INDArrayrepeat(INDArray n, int num)Create an n x (shape) ndarray where the ndarray is repeated num timesstatic INDArrayreverse(INDArray reverse)Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etcstatic INDArrayrot(INDArray reverse)Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etcstatic voidrot90(INDArray toRotate)Rotate a matrix 90 degreesstatic INDArrayscalar(double value)Create a scalar nd array with the specified value and offsetstatic INDArrayscalar(double value, int offset)Create a scalar nd array with the specified value and offsetstatic INDArrayscalar(float value)Create a scalar nd array with the specified value and offsetstatic INDArrayscalar(float value, int offset)Create a scalar nd array with the specified value and offsetstatic IComplexNDArrayscalar(IComplexDouble value)Create a scalar nd array with the specified value and offsetstatic IComplexNDArrayscalar(IComplexDouble value, int offset)Create a scalar nd array with the specified value and offsetstatic IComplexNDArrayscalar(IComplexFloat value)Create a scalar nd array with the specified value and offsetstatic IComplexNDArrayscalar(IComplexFloat value, int offset)Create a scalar nd array with the specified value and offsetstatic IComplexNDArrayscalar(IComplexNumber value)Create a scalar ndarray with the specified offsetstatic IComplexNDArrayscalar(IComplexNumber value, int offset)Create a scalar ndarray with the specified offsetstatic INDArrayscalar(java.lang.Number value)Create a scalar ndarray with the specified offsetstatic INDArrayscalar(java.lang.Number value, int offset)Create a scalar ndarray with the specified offsetstatic voidsetBlasWrapper(BlasWrapper factory)static voidsetFactory(NDArrayFactory factory)static IComplexNDArraysort(IComplexNDArray ndarray, int dimension, boolean ascending)Sort an ndarray along a particular dimensionstatic INDArraysort(INDArray ndarray, int dimension, boolean ascending)Sort an ndarray along a particular dimensionstatic INDArray[]sortWithIndices(IComplexNDArray ndarray, int dimension, boolean ascending)Sort an ndarray along a particular dimensionstatic INDArray[]sortWithIndices(INDArray ndarray, int dimension, boolean ascending)Sort an ndarray along a particular dimensionstatic INDArraytile(INDArray tile, int[] repeat)An alias for repmatstatic INDArraytoFlattened(java.util.Collection<INDArray> matrices)static INDArraytoFlattened(INDArray... matrices)static INDArraytoFlattened(int length, java.util.Iterator<? extends INDArray>... matrices)static INDArrayvalueArrayOf(int[] shape, double value)Creates an ndarray with the specified value as the only value in the ndarraystatic INDArrayvalueArrayOf(int num, double value)Creates an ndarray with the specified value as the only value in the ndarraystatic INDArrayvalueArrayOf(int rows, int columns, double value)Creates a row vector with the specified number of columnsstatic INDArrayvstack(INDArray... arrs)Concatenates two matrices vertically.static voidwrite(INDArray arr, java.io.DataOutputStream dataOutputStream)Write an ndarray to the specified outputs treamstatic voidwriteComplex(IComplexNDArray arr, java.io.DataOutputStream dataOutputStream)Write an ndarray to the specified outputs treamstatic voidwriteTxt(INDArray write, java.lang.String filePath, java.lang.String split)Read line via input streamsstatic INDArrayzeros(int columns)Creates a row vector with the specified number of columnsstatic INDArrayzeros(int[] shape)Create an ndarray of zerosstatic INDArrayzeros(int rows, int columns)Creates a row vector with the specified number of columns
-
-
-
Field Detail
-
LINALG_PROPS
public static final java.lang.String LINALG_PROPS
- See Also:
- Constant Field Values
-
REAL_CLASS_PROP
public static final java.lang.String REAL_CLASS_PROP
- See Also:
- Constant Field Values
-
COMPLEX_CLASS_PROP
public static final java.lang.String COMPLEX_CLASS_PROP
- See Also:
- Constant Field Values
-
DTYPE
public static final java.lang.String DTYPE
- See Also:
- Constant Field Values
-
BLAS_OPS
public static final java.lang.String BLAS_OPS
- See Also:
- Constant Field Values
-
dtype
public static java.lang.String dtype
-
ORDER
public static char ORDER
-
ORDER_KEY
public static final java.lang.String ORDER_KEY
- See Also:
- Constant Field Values
-
NDARRAY_FACTORY_CLASS
public static final java.lang.String NDARRAY_FACTORY_CLASS
- See Also:
- Constant Field Values
-
UNIT
public static final IComplexNumber UNIT
-
ZERO
public static final IComplexNumber ZERO
-
NEG_UNIT
public static final IComplexNumber NEG_UNIT
-
EPS_THRESHOLD
public static double EPS_THRESHOLD
-
MAX_ELEMENTS_PER_SLICE
public static int MAX_ELEMENTS_PER_SLICE
-
MAX_SLICES_TO_PRINT
public static int MAX_SLICES_TO_PRINT
-
-
Method Detail
-
factory
public static NDArrayFactory factory()
-
createBuffer
public static DataBuffer createBuffer(int[] shape)
Create a buffer equal of length prod(shape)- Parameters:
shape- the shape of the buffer to create- Returns:
- the created buffer
-
createBuffer
public static DataBuffer createBuffer(long length)
Creates a buffer of the specified length based on the data type- Parameters:
length- the length of te buffer- Returns:
- the buffer to create
-
createBuffer
public static DataBuffer createBuffer(float[] data)
-
createBuffer
public static DataBuffer createBuffer(double[] data)
-
createBuffer
public static <E> DataBuffer createBuffer(E[] data)
-
setFactory
public static void setFactory(NDArrayFactory factory)
-
setBlasWrapper
public static void setBlasWrapper(BlasWrapper factory)
-
order
public static java.lang.Character order()
Returns the ordering of the ndarrays- Returns:
- the ordering of the ndarrays
-
dataType
public static java.lang.String dataType()
Returns the data type used for the runtime- Returns:
- the datatype used for the runtime
-
getBlasWrapper
public static BlasWrapper getBlasWrapper()
-
createComplex
public static IComplexNDArray createComplex(INDArray real, INDArray imag)
Create a complex ndarray based on the real and imaginary- Parameters:
real- the real numbersimag- the imaginary components- Returns:
- the complex
-
repeat
public static IComplexNDArray repeat(IComplexNDArray n, int num)
Create an n x (shape) ndarray where the ndarray is repeated num times- Parameters:
n- the ndarray to replicatenum- the number of copies to repeat- Returns:
- the repeated ndarray
-
sortWithIndices
public static INDArray[] sortWithIndices(IComplexNDArray ndarray, int dimension, boolean ascending)
Sort an ndarray along a particular dimension- Parameters:
ndarray- the ndarray to sortdimension- the dimension to sort- Returns:
- an array with indices and the sorted ndarray
-
sortWithIndices
public static INDArray[] sortWithIndices(INDArray ndarray, int dimension, boolean ascending)
Sort an ndarray along a particular dimension- Parameters:
ndarray- the ndarray to sortdimension- the dimension to sort- Returns:
- the indices and the sorted ndarray
-
sort
public static IComplexNDArray sort(IComplexNDArray ndarray, int dimension, boolean ascending)
Sort an ndarray along a particular dimension- Parameters:
ndarray- the ndarray to sortdimension- the dimension to sort- Returns:
- the sorted ndarray
-
sort
public static INDArray sort(INDArray ndarray, int dimension, boolean ascending)
Sort an ndarray along a particular dimension- Parameters:
ndarray- the ndarray to sortdimension- the dimension to sort- Returns:
- the sorted ndarray
-
repeat
public static INDArray repeat(INDArray n, int num)
Create an n x (shape) ndarray where the ndarray is repeated num times- Parameters:
n- the ndarray to replicatenum- the number of copies to repeat- Returns:
- the repeated ndarray
-
linspace
public static INDArray linspace(int lower, int upper, int num)
Generate a linearly spaced vector- Parameters:
lower- upper boundupper- lower boundnum- the step size- Returns:
- the linearly spaced vector
-
complexFlatten
public static IComplexNDArray complexFlatten(java.util.List<IComplexNDArray> flatten)
-
complexFlatten
public static IComplexNDArray complexFlatten(IComplexNDArray... flatten)
-
toFlattened
public static INDArray toFlattened(int length, java.util.Iterator<? extends INDArray>... matrices)
-
bilinearProducts
public 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.
-
eye
public static INDArray eye(int n)
Create the identity ndarray- Parameters:
n- the number for the identity- Returns:
-
rot90
public static void rot90(INDArray toRotate)
Rotate a matrix 90 degrees- Parameters:
toRotate- the matrix to rotate
-
writeTxt
public static void writeTxt(INDArray write, java.lang.String filePath, java.lang.String split) throws java.io.IOException
Read line via input streams- Parameters:
filePath- the input stream ndarraysplit- the split separator- Throws:
java.io.IOException
-
readTxt
public static INDArray readTxt(java.lang.String filePath, java.lang.String split) throws java.io.IOException
Read line via input streams- Parameters:
filePath- the input stream ndarraysplit- the split separator- Returns:
- the read txt method
- Throws:
java.io.IOException
-
readTxt
public static INDArray readTxt(java.lang.String filePath) throws java.io.IOException
Read line via input streams- Parameters:
filePath- the input stream ndarray- Returns:
- the read txt method
- Throws:
java.io.IOException
-
read
public static INDArray read(java.io.DataInputStream dis) throws java.io.IOException
Read in an ndarray from a data input stream- Parameters:
dis- the data input stream to read from- Returns:
- the ndarray
- Throws:
java.io.IOException
-
write
public static void write(INDArray arr, java.io.DataOutputStream dataOutputStream) throws java.io.IOException
Write an ndarray to the specified outputs tream- Parameters:
arr- the array to writedataOutputStream- the data output stream to write to- Throws:
java.io.IOException
-
create
public static INDArray create(double[][] data)
Create an ndarray based on the given data layout- Parameters:
data- the data to use- Returns:
- an ndarray with the given data layout
-
readComplex
public static IComplexNDArray readComplex(java.io.DataInputStream dis) throws java.io.IOException
Read in an ndarray from a data input stream- Parameters:
dis- the data input stream to read from- Returns:
- the ndarray
- Throws:
java.io.IOException
-
writeComplex
public static void writeComplex(IComplexNDArray arr, java.io.DataOutputStream dataOutputStream) throws java.io.IOException
Write an ndarray to the specified outputs tream- Parameters:
arr- the array to writedataOutputStream- the data output stream to write to- Throws:
java.io.IOException
-
rot
public static INDArray rot(INDArray reverse)
Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc- Parameters:
reverse- the matrix to reverse- Returns:
- the reversed matrix
-
reverse
public static INDArray reverse(INDArray reverse)
Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc- Parameters:
reverse- the matrix to reverse- Returns:
- the reversed matrix
-
arange
public static INDArray arange(double begin, double end)
Array of evenly spaced values.- Parameters:
begin- the begin of the rangeend- the end of the range- Returns:
- the range vector
-
createComplexNumber
public static IComplexFloat createComplexNumber(java.lang.Number real, java.lang.Number imag)
Create double- Parameters:
real- real componentimag- imag component- Returns:
-
createFloat
public static IComplexFloat createFloat(float real, float imag)
Create double- Parameters:
real- real componentimag- imag component- Returns:
-
createDouble
public static IComplexDouble createDouble(double real, double imag)
Create an instance of a complex double- Parameters:
real- the real componentimag- the imaginary component- Returns:
- a new imaginary double with the specified real and imaginary components
-
copy
public static void copy(INDArray a, INDArray b)
Copy a to b- Parameters:
a- the origin matrixb- the destination matrix
-
rand
public static INDArray rand(int[] shape, double min, double max, RandomGenerator rng)
Generates a random matrix between min and max- Parameters:
shape- the number of rows of the matrixmin- the minimum numbermax- the maximum numberrng- the rng to use- Returns:
- a drandom matrix of the specified shape and range
-
rand
public static INDArray rand(int rows, int columns, double min, double max, RandomGenerator rng)
Generates a random matrix between min and max- Parameters:
rows- the number of rows of the matrixcolumns- the number of columns in the matrixmin- the minimum numbermax- the maximum numberrng- the rng to use- Returns:
- a drandom matrix of the specified shape and range
-
diag
public 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- Parameters:
x- the diagonal valuesk- the kth diagonal to getDouble- Returns:
- new matrix
-
diag
public 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- Parameters:
x- the diagonal valuesk- the kth diagonal to getDouble- Returns:
- new matrix
-
diag
public 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- Parameters:
x- the diagonal values- Returns:
- new matrix
-
diag
public 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- Parameters:
x- the diagonal values- Returns:
- new matrix
-
doAlongDiagonal
public static void doAlongDiagonal(INDArray x, Function<java.lang.Number,java.lang.Number> func)
Perform an operation along a diagonal- Parameters:
x- the ndarray to perform the operation onfunc- the operation to perform
-
doAlongDiagonal
public static void doAlongDiagonal(IComplexNDArray x, Function<IComplexNumber,IComplexNumber> func)
Perform an operation along a diagonal- Parameters:
x- the ndarray to perform the operation onfunc- the operation to perform
-
createComplex
public static IComplexNDArray createComplex(INDArray arr)
Create a complex ndarray from the passed in indarray- Parameters:
arr- the arr to wrap- Returns:
- the complex ndarray with the specified ndarray as the real components
-
createComplex
public static IComplexNDArray createComplex(IComplexNumber[] data, int[] shape)
Create a complex ndarray from the passed in indarray- Parameters:
data- the data to wrap- Returns:
- the complex ndarray with the specified ndarray as the real components
-
createComplex
public static IComplexNDArray createComplex(IComplexNumber[] data, int[] shape, int offset, char ordering)
Create a complex ndarray from the passed in indarray- Parameters:
data- the data to wrap- Returns:
- the complex ndarray with the specified ndarray as the real components
-
createComplex
public static IComplexNDArray createComplex(java.util.List<IComplexNDArray> arrs, int[] shape)
Create a complex ndarray from the passed in indarray- Parameters:
arrs- the arr to wrap- Returns:
- the complex ndarray with the specified ndarray as the real components
-
rand
public static INDArray rand(int rows, int columns, RandomGenerator r)
Create a random ndarray with the given shape using the given rng- Parameters:
rows- the number of rows in the matrixcolumns- the number of columns in the matrixr- the random generator to use- Returns:
- the random ndarray with the specified shape
-
rand
public static INDArray rand(int rows, int columns, long seed)
Create a random ndarray with the given shape using the given rng- Parameters:
rows- the number of rows in the matrixcolumns- the columns of the ndarrayseed- the seed to use- Returns:
- the random ndarray with the specified shape
-
rand
public static INDArray rand(int rows, int columns)
Create a random ndarray with the given shape using the current time as the seed- Parameters:
rows- the number of rows in the matrixcolumns- the number of columns in the matrix- Returns:
- the random ndarray with the specified shape
-
randn
public static INDArray randn(int rows, int columns, RandomGenerator r)
Random normal using the given rng- Parameters:
rows- the number of rows in the matrixcolumns- the number of columns in the matrixr- the random generator to use- Returns:
-
randn
public static INDArray randn(int rows, int columns)
Random normal using the current time stamp as the seed- Parameters:
rows- the number of rows in the matrixcolumns- the number of columns in the matrix- Returns:
-
randn
public static INDArray randn(int rows, int columns, long seed)
Random normal using the specified seed- Parameters:
rows- the number of rows in the matrixcolumns- the number of columns in the matrix- Returns:
-
rand
public static INDArray rand(int[] shape, RealDistribution r)
Create a random ndarray with the given shape using the given rng- Parameters:
shape- the shape of the ndarrayr- the random generator to use- Returns:
- the random ndarray with the specified shape
-
rand
public static INDArray rand(int[] shape, RandomGenerator r)
Create a random ndarray with the given shape using the given rng- Parameters:
shape- the shape of the ndarrayr- the random generator to use- Returns:
- the random ndarray with the specified shape
-
rand
public static INDArray rand(int[] shape, long seed)
Create a random ndarray with the given shape using the given rng- Parameters:
shape- the shape of the ndarrayseed- the seed to use- Returns:
- the random ndarray with the specified shape
-
rand
public static INDArray rand(int[] shape)
Create a random ndarray with the given shape using the current time as the seed- Parameters:
shape- the shape of the ndarray- Returns:
- the random ndarray with the specified shape
-
randn
public static INDArray randn(int[] shape, RandomGenerator r)
Random normal using the given rng- Parameters:
shape- the shape of the ndarrayr- the random generator to use- Returns:
-
randn
public static INDArray randn(int[] shape)
Random normal using the current time stamp as the seed- Parameters:
shape- the shape of the ndarray- Returns:
-
randn
public static INDArray randn(int[] shape, long seed)
Random normal using the specified seed- Parameters:
shape- the shape of the ndarray- Returns:
-
create
public static INDArray create(float[] data, char order)
Creates a row vector with the data- Parameters:
data- the columns of the ndarray- Returns:
- the created ndarray
-
create
public static INDArray create(double[] data, char order)
Creates a row vector with the data- Parameters:
data- the columns of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(double[] data, char order)
Creates an ndarray with the specified data- Parameters:
data- the number of columns in the row vector- Returns:
- ndarray
-
create
public static INDArray create(int columns, char order)
Creates a row vector with the specified number of columns- Parameters:
columns- the columns of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(int columns, char order)
Creates an ndarray- Parameters:
columns- the number of columns in the row vector- Returns:
- ndarray
-
create
public static INDArray create(float[] data)
Creates a row vector with the data- Parameters:
data- the columns of the ndarray- Returns:
- the created ndarray
-
create
public static INDArray create(double[] data)
Creates a row vector with the data- Parameters:
data- the columns of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(float[] data)
Creates an ndarray with the specified data- Parameters:
data- the number of columns in the row vector- Returns:
- ndarray
-
create
public static INDArray create(int columns)
Creates a row vector with the specified number of columns- Parameters:
columns- the columns of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(int columns)
Creates an ndarray- Parameters:
columns- the number of columns in the row vector- Returns:
- ndarray
-
hasInvalidNumber
public static boolean hasInvalidNumber(INDArray num)
Returns true if the given ndarray has either an infinite or nan- Parameters:
num- the ndarray to test- Returns:
- true if the given ndarray has either infinite or nan false otherwise
-
zeros
public static INDArray zeros(int rows, int columns)
Creates a row vector with the specified number of columns- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarray- Returns:
- the created ndarray
-
complexZeros
public static INDArray complexZeros(int rows, int columns)
Creates a matrix of zeros- Parameters:
rows- te number of rows in the matrixcolumns- the number of columns in the row vector- Returns:
- ndarray
-
zeros
public static INDArray zeros(int columns)
Creates a row vector with the specified number of columns- Parameters:
columns- the columns of the ndarray- Returns:
- the created ndarray
-
complexZeros
public static INDArray complexZeros(int columns)
Creates an ndarray- Parameters:
columns- the number of columns in the row vector- Returns:
- ndarray
-
complexValueOf
public static IComplexNDArray complexValueOf(int num, IComplexNumber value)
-
complexValueOf
public static IComplexNDArray complexValueOf(int[] shape, IComplexNumber value)
-
complexValueOf
public static IComplexNDArray complexValueOf(int num, double value)
-
complexValueOf
public static IComplexNDArray complexValueOf(int[] shape, double value)
-
valueArrayOf
public static INDArray valueArrayOf(int[] shape, double value)
Creates an ndarray with the specified value as the only value in the ndarray- Parameters:
shape- the shape of the ndarrayvalue- the value to assign- Returns:
- the created ndarray
-
valueArrayOf
public static INDArray valueArrayOf(int num, double value)
Creates an ndarray with the specified value as the only value in the ndarray- Parameters:
num- number of columnsvalue- the value to assign- Returns:
- the created ndarray
-
valueArrayOf
public static INDArray valueArrayOf(int rows, int columns, double value)
Creates a row vector with the specified number of columns- Parameters:
rows- the number of rows in the matrixcolumns- the columns of the ndarrayvalue- the value to assign- Returns:
- the created ndarray
-
ones
public static INDArray ones(int rows, int columns)
Creates a row vector with the specified number of columns- Parameters:
rows- the number of rows in the matrixcolumns- the columns of the ndarray- Returns:
- the created ndarray
-
complexOnes
public static INDArray complexOnes(int rows, int columns)
Creates an ndarray- Parameters:
rows- the number of rows in the matrixcolumns- the number of columns in the row vector- Returns:
- ndarray
-
ones
public static INDArray ones(int columns)
Creates a row vector with the specified number of columns- Parameters:
columns- the columns of the ndarray- Returns:
- the created ndarray
-
complexOnes
public static IComplexNDArray complexOnes(int columns)
Creates an ndarray- Parameters:
columns- the number of columns in the row vector- Returns:
- ndarray
-
hstack
public static INDArray hstack(INDArray... arrs)
Concatenates two matrices horizontally. Matrices must have identical numbers of rows.- Parameters:
arrs- the first matrix to concat
-
vstack
public static INDArray vstack(INDArray... arrs)
Concatenates two matrices vertically. Matrices must have identical numbers of columns.- Parameters:
arrs-
-
concat
public static INDArray concat(int dimension, INDArray... toConcat)
Concatneate ndarrays along a dimension- Parameters:
dimension- the dimension to concatneate alongtoConcat- the ndarrays to concat- Returns:
- the concatted ndarrays with an output shape of the ndarray shapes save the dimension shape specified which is then the sum of the sizes along that dimension
-
concat
public static IComplexNDArray concat(int dimension, IComplexNDArray... toConcat)
Concatneate ndarrays along a dimension- Parameters:
dimension- the dimension to concatneate alongtoConcat- the ndarrays to concat- Returns:
- the concatted ndarrays with an output shape of the ndarray shapes save the dimension shape specified which is then the sum of the sizes along that dimension
-
zeros
public static INDArray zeros(int[] shape)
Create an ndarray of zeros- Parameters:
shape- the shape of the ndarray- Returns:
- an ndarray with ones filled in
-
complexZeros
public static IComplexNDArray complexZeros(int[] shape)
Create an ndarray of ones- Parameters:
shape- the shape of the ndarray- Returns:
- an ndarray with ones filled in
-
ones
public static INDArray ones(int[] shape)
Create an ndarray of ones- Parameters:
shape- the shape of the ndarray- Returns:
- an ndarray with ones filled in
-
complexOnes
public static IComplexNDArray complexOnes(int[] shape)
Create an ndarray of ones- Parameters:
shape- the shape of the ndarray- Returns:
- an ndarray with ones filled in
-
createComplex
public static IComplexNDArray createComplex(float[] data, int rows, int columns, int[] stride, int offset)
Creates a complex ndarray with the specified shape- Parameters:
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 ndarray- Returns:
- the instance
-
create
public static INDArray create(float[] data, int rows, int columns, int[] stride, int offset)
Creates an ndarray with the specified shape- Parameters:
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 ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(double[] data, int[] shape, int[] stride, int offset)
Creates a complex ndarray with the specified shape- Parameters:
data- the data to use with the ndarrayshape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(double[] data, int[] shape, int[] stride, int offset)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(double[] data, int[] shape)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarray- Returns:
- the created ndarray
-
create
public static INDArray create(float[] data, int[] shape)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(float[] data, int[] shape)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(double[] data, int[] shape)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(float[] data, int[] shape, int[] stride)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarraystride- the stride for the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(double[] data, int[] shape, int[] stride)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarraystride- the stride for the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(double[] data, int rows, int columns, int[] stride, int offset)
Creates a complex ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(double[] data, int rows, int columns, int[] stride, int offset)
Creates an ndarray with the specified shape- Parameters:
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 ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(float[] data, int[] shape, int[] stride, int offset)
Creates a complex ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(float[] data, int[] shape, int offset)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(double[] data, int[] shape, int offset, char ordering)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(float[] data, int[] shape, int[] stride, int offset)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(java.util.List<INDArray> list, int[] shape)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int rows, int columns, int[] stride, int offset)
Creates a complex ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(int rows, int columns, int[] stride, int offset)
Creates an ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int[] shape, int[] stride, int offset)
Creates a complex ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(int[] shape, int[] stride, int offset)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int rows, int columns, int[] stride)
Creates a complex ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarray- Returns:
- the instance
-
create
public static INDArray create(int rows, int columns, int[] stride)
Creates an ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int[] shape, int[] stride)
Creates a complex ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarray- Returns:
- the instance
-
create
public static INDArray create(int[] shape, int[] stride)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int rows, int columns)
Creates a complex ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarray- Returns:
- the instance
-
create
public static INDArray create(int rows, int columns)
Creates an ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int[] shape)
Creates a complex ndarray with the specified shape- Parameters:
shape- the shape of the ndarray- Returns:
- the instance
-
create
public static INDArray create(int[] shape)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarray- Returns:
- the instance
-
scalar
public static INDArray scalar(java.lang.Number value, int offset)
Create a scalar ndarray with the specified offset- Parameters:
value- the value to initialize the scalar withoffset- the offset of the ndarray- Returns:
- the created ndarray
-
complexScalar
public static IComplexNDArray complexScalar(java.lang.Number value, int offset)
Create a scalar ndarray with the specified offset- Parameters:
value- the value to initialize the scalar withoffset- the offset of the ndarray- Returns:
- the created ndarray
-
complexScalar
public static IComplexNDArray complexScalar(java.lang.Number value)
Create a scalar ndarray with the specified offset- Parameters:
value- the value to initialize the scalar with- Returns:
- the created ndarray
-
scalar
public static INDArray scalar(double value, int offset)
Create a scalar nd array with the specified value and offset- Parameters:
value- the value of the scalaroffset- the offset of the ndarray- Returns:
- the scalar nd array
-
scalar
public static INDArray scalar(float value, int offset)
Create a scalar nd array with the specified value and offset- Parameters:
value- the value of the scalaroffset- the offset of the ndarray- Returns:
- the scalar nd array
-
scalar
public static INDArray scalar(java.lang.Number value)
Create a scalar ndarray with the specified offset- Parameters:
value- the value to initialize the scalar with- Returns:
- the created ndarray
-
scalar
public static INDArray scalar(double value)
Create a scalar nd array with the specified value and offset- Parameters:
value- the value of the scalar = * @return the scalar nd array
-
scalar
public static INDArray scalar(float value)
Create a scalar nd array with the specified value and offset- Parameters:
value- the value of the scalar = * @return the scalar nd array
-
scalar
public static IComplexNDArray scalar(IComplexNumber value, int offset)
Create a scalar ndarray with the specified offset- Parameters:
value- the value to initialize the scalar withoffset- the offset of the ndarray- Returns:
- the created ndarray
-
scalar
public static IComplexNDArray scalar(IComplexFloat value)
Create a scalar nd array with the specified value and offset- Parameters:
value- the value of the scalar- Returns:
- the scalar nd array
-
scalar
public static IComplexNDArray scalar(IComplexDouble value)
Create a scalar nd array with the specified value and offset- Parameters:
value- the value of the scalar = * @return the scalar nd array
-
scalar
public static IComplexNDArray scalar(IComplexNumber value)
Create a scalar ndarray with the specified offset- Parameters:
value- the value to initialize the scalar with- Returns:
- the created ndarray
-
scalar
public static IComplexNDArray scalar(IComplexFloat value, int offset)
Create a scalar nd array with the specified value and offset- Parameters:
value- the value of the scalaroffset- the offset of the ndarray- Returns:
- the scalar nd array
-
scalar
public static IComplexNDArray scalar(IComplexDouble value, int offset)
Create a scalar nd array with the specified value and offset- Parameters:
value- the value of the scalaroffset- the offset of the ndarray- Returns:
- the scalar nd array
-
getStrides
public static int[] getStrides(int[] shape, char order)Get the strides for the given order and shape- Parameters:
shape- the shape of the ndarrayorder- the order to getScalar the strides for- Returns:
- the strides for the given shape and order
-
getStrides
public static int[] getStrides(int[] shape)
Get the strides based on the shape and NDArrays.order()- Parameters:
shape- the shape of the ndarray- Returns:
- the strides for the given shape and order specified by NDArrays.order()
-
tile
public static INDArray tile(INDArray tile, int[] repeat)
An alias for repmat- Parameters:
tile- the ndarray to tilerepeat- the shape to repeat- Returns:
- the tiled ndarray
-
getComplexStrides
public static int[] getComplexStrides(int[] shape, char order)Get the strides for the given order and shape- Parameters:
shape- the shape of the ndarrayorder- the order to getScalar the strides for- Returns:
- the strides for the given shape and order
-
getComplexStrides
public static int[] getComplexStrides(int[] shape)
Get the strides based on the shape and NDArrays.order()- Parameters:
shape- the shape of the ndarray- Returns:
- the strides for the given shape and order specified by NDArrays.order()
-
createComplex
public static IComplexNDArray createComplex(float[] data, int rows, int columns, int[] stride, int offset, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
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 ndarray- Returns:
- the instance
-
create
public static INDArray create(float[] data, int rows, int columns, int[] stride, int offset, char ordering)
Creates an ndarray with the specified shape- Parameters:
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 ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(float[] data, int[] shape, int[] stride, int offset, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
data- the data to use with the ndarrayshape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(double[] data, int[] shape, int[] stride, int offset, char ordering)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(double[] data, int[] shape, char ordering)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarray- Returns:
- the created ndarray
-
create
public static INDArray create(float[] data, int[] shape, char ordering)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(float[] data, int[] shape, char ordering)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(double[] data, int[] shape, char ordering)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(float[] data, int[] shape, int[] stride, char ordering)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarraystride- the stride for the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(double[] data, int[] shape, int[] stride, char ordering)
Create an ndrray with the specified shape- Parameters:
data- the data to use with tne ndarrayshape- the shape of the ndarraystride- the stride for the ndarray- Returns:
- the created ndarray
-
createComplex
public static IComplexNDArray createComplex(double[] data, int rows, int columns, int[] stride, int offset, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(double[] data, int rows, int columns, int[] stride, int offset, char ordering)
Creates an ndarray with the specified shape- Parameters:
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 ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(double[] data, int[] shape, int[] stride, int offset, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(float[] data, int[] shape, int[] stride, int offset, char ordering)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(java.util.List<INDArray> list, int[] shape, char ordering)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int rows, int columns, int[] stride, int offset, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(int rows, int columns, int[] stride, int offset, char ordering)
Creates an ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int[] shape, int[] stride, int offset, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
create
public static INDArray create(int[] shape, int[] stride, int offset, char ordering)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarrayoffset- the offset of the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int rows, int columns, int[] stride, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarray- Returns:
- the instance
-
create
public static INDArray create(int rows, int columns, int[] stride, char ordering)
Creates an ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarraystride- the stride for the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int[] shape, int[] stride, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarray- Returns:
- the instance
-
create
public static INDArray create(int[] shape, int[] stride, char ordering)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarraystride- the stride for the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int rows, int columns, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarray- Returns:
- the instance
-
create
public static INDArray create(int rows, int columns, char ordering)
Creates an ndarray with the specified shape- Parameters:
rows- the rows of the ndarraycolumns- the columns of the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(int[] shape, char ordering)
Creates a complex ndarray with the specified shape- Parameters:
shape- the shape of the ndarray- Returns:
- the instance
-
create
public static INDArray create(int[] shape, char ordering)
Creates an ndarray with the specified shape- Parameters:
shape- the shape of the ndarray- Returns:
- the instance
-
createComplex
public static IComplexNDArray createComplex(float[] data, int[] ints, int offset, char ordering)
-
createComplex
public static IComplexNDArray createComplex(double[] data, int[] shape, int offset)
-
create
public static INDArray create(double[] data, int[] shape, int offset)
-
createComplex
public static IComplexNDArray createComplex(double[] data, int[] ints, int offset, char ordering)
-
createComplex
public static IComplexNDArray createComplex(double[] dim)
-
createComplex
public static IComplexNDArray createComplex(float[] data, int[] shape, int offset)
-
create
public static INDArray create(float[][] doubles)
-
complexLinSpace
public static IComplexNDArray complexLinSpace(int i, int i1, int i2)
-
create
public static INDArray create(float[] data, int[] shape, int[] stride, char ordering, int offset)
-
create
public static INDArray create(float[] data, int[] shape, char ordering, int offset)
-
create
public static INDArray create(DataBuffer data, int[] shape, int[] strides, int offset)
-
create
public static INDArray create(DataBuffer data, int[] shape, int offset)
-
create
public static INDArray create(DataBuffer data, int[] newShape, int[] newStride, int offset, char ordering)
-
createComplex
public static IComplexNDArray createComplex(DataBuffer data, int[] newShape, int[] newStrides, int offset)
-
createComplex
public static IComplexNDArray createComplex(DataBuffer data, int[] shape, int offset)
-
createComplex
public static IComplexNDArray createComplex(DataBuffer data, int[] newDims, int[] newStrides, int offset, char ordering)
-
createComplex
public static IComplexNDArray createComplex(DataBuffer data, int[] shape, int offset, char ordering)
-
create
public static INDArray create(DataBuffer data, int[] shape)
-
createComplex
public static IComplexNDArray createComplex(DataBuffer data, int[] shape)
-
create
public static INDArray create(DataBuffer buffer)
-
-
DMelt 3.0 © DataMelt by jWork.ORG