Documentation of 'org.nd4j.linalg.factory.Nd4j' Java class
Nd4j
org.nd4j.linalg.factory

Class Nd4j



  • public class Nd4j
    extends java.lang.Object
    Creation of ndarrays via classpath discovery.
    • Field Detail

      • COMPLEX_CLASS_PROP

        public static final java.lang.String COMPLEX_CLASS_PROP
        See Also:
        Constant Field Values
      • dtype

        public static java.lang.String dtype
      • ORDER

        public static char ORDER
      • NDARRAY_FACTORY_CLASS

        public static final java.lang.String NDARRAY_FACTORY_CLASS
        See Also:
        Constant Field Values
      • 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
    • Constructor Detail

      • Nd4j

        public Nd4j()
    • Method Detail

      • 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)
      • 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 numbers
        imag - 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 replicate
        num - 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 sort
        dimension - 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 sort
        dimension - 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 sort
        dimension - 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 sort
        dimension - 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 replicate
        num - 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 bound
        upper - lower bound
        num - the step size
        Returns:
        the linearly spaced vector
      • toFlattened

        public static INDArray toFlattened(java.util.Collection<INDArray> matrices)
      • 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 ndarray
        split - 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 ndarray
        split - 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 write
        dataOutputStream - 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 write
        dataOutputStream - 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 range
        end - 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 component
        imag - imag component
        Returns:
      • createFloat

        public static IComplexFloat createFloat(float real,
                                                float imag)
        Create double
        Parameters:
        real - real component
        imag - imag component
        Returns:
      • createDouble

        public static IComplexDouble createDouble(double real,
                                                  double imag)
        Create an instance of a complex double
        Parameters:
        real - the real component
        imag - 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 matrix
        b - 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 matrix
        min - the minimum number
        max - the maximum number
        rng - 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 matrix
        columns - the number of columns in the matrix
        min - the minimum number
        max - the maximum number
        rng - 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 values
        k - 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 values
        k - 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 on
        func - 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 matrix
        columns - the number of columns in the matrix
        r - 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 matrix
        columns - the columns of the ndarray
        seed - 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 matrix
        columns - 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 matrix
        columns - the number of columns in the matrix
        r - 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 matrix
        columns - 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 matrix
        columns - 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 ndarray
        r - 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 ndarray
        r - 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 ndarray
        seed - 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 ndarray
        r - 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 ndarray
        columns - 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 matrix
        columns - 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,
                                                     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 ndarray
        value - 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 columns
        value - 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 matrix
        columns - the columns of the ndarray
        value - 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 matrix
        columns - 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 matrix
        columns - 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 along
        toConcat - 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 along
        toConcat - 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 ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        shape - 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 ndarray
        shape - 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 ndarray
        shape - 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 ndarray
        shape - 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 ndarray
        shape - the shape of the ndarray
        stride - 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 ndarray
        shape - the shape of the ndarray
        stride - 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 ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        offset - 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 ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        columns - the columns of the ndarray
        stride - 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 ndarray
        columns - the columns of the ndarray
        stride - 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 ndarray
        stride - 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 ndarray
        stride - 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 ndarray
        columns - 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 ndarray
        columns - 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 with
        offset - 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 with
        offset - 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 scalar
        offset - 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 scalar
        offset - 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 with
        offset - 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 scalar
        offset - 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 scalar
        offset - 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 ndarray
        order - 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 tile
        repeat - 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 ndarray
        order - 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 ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        shape - 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 ndarray
        shape - 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 ndarray
        shape - 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 ndarray
        shape - 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 ndarray
        shape - the shape of the ndarray
        stride - 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 ndarray
        shape - the shape of the ndarray
        stride - 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 ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        stride - the stride for the ndarray
        offset - 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 ndarray
        columns - the columns of the ndarray
        stride - 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 ndarray
        columns - the columns of the ndarray
        stride - 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 ndarray
        stride - 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 ndarray
        stride - 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 ndarray
        columns - 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 ndarray
        columns - 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[] 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[] newDims,
                                                    int[] newStrides,
                                                    int offset,
                                                    char ordering)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.