/** * Create a long row vector of all of the given ndarrays * @param matrices the matrices to create the flattened ndarray for * @return the flattened representation of * these ndarrays */ public static INDArray toFlattened(Collection<INDArray> matrices) { INDArray ret = INSTANCE.toFlattened(matrices); logCreationIfNecessary(ret); return ret; }
/** * Create a long row vector of all of the given ndarrays * @param flatten the matrices to create the flattened ndarray for * @return the flattened representation of * these ndarrays */ public static IComplexNDArray complexFlatten(IComplexNDArray... flatten) { IComplexNDArray ret = INSTANCE.complexFlatten(flatten); logCreationIfNecessary(ret); return ret; }
/** * Create a long row vector of all of the given ndarrays * @param matrices the matrices to create the flattened ndarray for * @return the flattened representation of * these ndarrays */ public static INDArray toFlattened(int length, Iterator<? extends INDArray>... matrices) { INDArray ret = INSTANCE.toFlattened(length, matrices); logCreationIfNecessary(ret); return ret; }
/** * Creates a row vector with the specified number of columns * * @param rows the rows of the sndarray * @param columns the columns of the ndarray * @return the created ndarray */ public static INDArray zeros(long rows, long columns) { INDArray ret = INSTANCE.zeros(rows, columns); logCreationIfNecessary(ret); return ret; }
/** * Creates an ndarray * * @param columns the number of columns in the row vector * @return ndarray */ public static IComplexNDArray complexOnes(int columns) { IComplexNDArray ret = INSTANCE.complexOnes(columns); logCreationIfNecessary(ret); return ret; }
/** * Concatenates two matrices vertically. Matrices must have identical * numbers of columns. * * @param arrs */ public static INDArray vstack(INDArray... arrs) { INDArray ret = INSTANCE.vstack(arrs); logCreationIfNecessary(ret); return ret; }
/** * Concatenates two matrices vertically. Matrices must have identical * numbers of columns. * * @param arrs */ public static INDArray vstack(Collection<INDArray> arrs) { INDArray[] arrays = arrs.toArray(new INDArray[0]); INDArray ret = INSTANCE.vstack(arrays); logCreationIfNecessary(ret); return ret; }
/** * Create a scalar nd array with the specified value and offset * * @param value the value of the scalar * @param offset the offset of the ndarray * @return the scalar nd array */ public static INDArray scalar(float value, long offset) { INDArray ret = INSTANCE.scalar(value, offset); logCreationIfNecessary(ret); return ret; }
/** * Create a scalar ndarray with the specified offset * * @param value the value to initialize the scalar with * @return the created ndarray */ public static IComplexNDArray scalar(IComplexNumber value) { IComplexNDArray ret = INSTANCE.scalar(value); logCreationIfNecessary(ret); return ret; }
/** * * @param dim * @return */ public static IComplexNDArray createComplex(double[] dim) { IComplexNDArray ret = INSTANCE.createComplex(dim, new int[] {1, dim.length / 2}); logCreationIfNecessary(ret); return ret; }
/** * Concatenates two matrices horizontally. Matrices must have identical * numbers of rows. * * @param arrs the first matrix to concat */ public static INDArray hstack(INDArray... arrs) { INDArray ret = INSTANCE.hstack(arrs); logCreationIfNecessary(ret); return ret; }
/** * Create a scalar nd array with the specified value and offset * * @param value the value of the scalar * @return the scalar nd array */ public static IComplexNDArray scalar(IComplexFloat value) { IComplexNDArray ret = INSTANCE.scalar(value); logCreationIfNecessary(ret); return ret; }
/** * Create a random ndarray with the given shape and array order * * @param order the order of the ndarray to return * @param shape the shape of the ndarray * @return the random ndarray with the specified shape */ public static INDArray rand(char order, int[] shape) { INDArray ret = Nd4j.createUninitialized(shape, order); //INSTANCE.rand(order, shape); logCreationIfNecessary(ret); return rand(ret); }
public static INDArray create(DataBuffer data, long[] shape) { checkShapeValues(shape); INDArray ret = INSTANCE.create(data, shape); logCreationIfNecessary(ret); return ret; }
/** * * @param shape * @param value * @return */ public static IComplexNDArray complexValueOf(int[] shape, IComplexNumber value) { checkShapeValues(shape); IComplexNDArray ret = INSTANCE.complexValueOf(shape, value); logCreationIfNecessary(ret); return ret; }
public static INDArray randn(long[] shape) { INDArray ret = Nd4j.createUninitialized(shape, order()); logCreationIfNecessary(ret); return randn(ret); }
/** * Random normal using the given rng * * @param shape the shape of the ndarray * @param r the random generator to use * @return */ public static INDArray randn(long[] shape, org.nd4j.linalg.api.rng.Random r) { final INDArray ret = Nd4j.createUninitialized(shape, order()); logCreationIfNecessary(ret); return randn(ret, r); }
public static INDArray create(List<INDArray> list, long[] shape) { shape = getEnsuredShape(shape); checkShapeValues(shape); INDArray ret = INSTANCE.create(list, shape); logCreationIfNecessary(ret); return ret; }
/** * Random normal using the current time stamp * as the seed * * @param shape the shape of the ndarray * @return */ public static INDArray randn(int[] shape) { INDArray ret = Nd4j.createUninitialized(shape, order()); logCreationIfNecessary(ret); return randn(ret); }
public static DataBuffer createBufferDetached(double[] data) { DataBuffer ret; if (dataType() == DataBuffer.Type.DOUBLE) ret = DATA_BUFFER_FACTORY_INSTANCE.createDouble(data); else if (dataType() == DataBuffer.Type.HALF) ret = DATA_BUFFER_FACTORY_INSTANCE.createHalf(ArrayUtil.toFloats(data)); else ret = DATA_BUFFER_FACTORY_INSTANCE.createFloat(ArrayUtil.toFloats(data)); logCreationIfNecessary(ret); return ret; }