org.nd4j.linalg.factory.Nd4j.createComplex()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中org.nd4j.linalg.factory.Nd4j.createComplex()方法的一些代码示例,展示了Nd4j.createComplex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Nd4j.createComplex()方法的具体详情如下:
包路径:org.nd4j.linalg.factory.Nd4j
类名称:Nd4j
方法名:createComplex

Nd4j.createComplex介绍

[英]Creates an ndarray
[中]制造混乱

代码示例

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Create a complex array from the given numbers
 * @param iComplexNumbers the numbers to use
 * @return the complex numbers
 */
public static IComplexNDArray createComplex(IComplexNumber[] iComplexNumbers) {
  if (iComplexNumbers == null || iComplexNumbers.length < 1)
    throw new ND4JIllegalStateException("Number of complex numbers can't be < 1 for new INDArray");
  return createComplex(iComplexNumbers, new int[] {1, iComplexNumbers.length});
}

代码示例来源:origin: deeplearning4j/nd4j

@Override
public IComplexNDArray mean(int... dimension) {
  return Nd4j.createComplex(super.mean(dimension));
}

代码示例来源:origin: deeplearning4j/nd4j

@Override
protected IComplexNDArray create(DataBuffer buffer) {
  return Nd4j.createComplex(buffer, new int[] {1, (int) buffer.length()});
}

代码示例来源:origin: deeplearning4j/nd4j

@Override
public IComplexNDArray divi(IComplexNumber n, IComplexNDArray result) {
  return Nd4j.createComplex(this).divi(n, result);
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Creates an ndarray with the specified data
 *
 * @param data the number of columns in the row vector
 * @return ndarray
 */
public static IComplexNDArray createComplex(float[] data) {
  return createComplex(data, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

protected INDArray create(int[] shape, char ordering) {
  if (this instanceof IComplexNDArray)
    return Nd4j.createComplex(shape, ordering);
  else
    return Nd4j.create(shape, ordering);
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 *
 * @param data
 * @param shape
 * @param offset
 * @return
 */
public static IComplexNDArray createComplex(double[] data, int[] shape, long offset) {
  return createComplex(data, shape, offset, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

private INDArray create(int[] shape, int[] stride) {
  if (this instanceof IComplexNDArray)
    return Nd4j.createComplex(shape, stride);
  else
    return Nd4j.create(shape, stride);
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Creates an ndarray
 *
 * @param columns the number of columns in the row vector
 * @return ndarray
 */
public static IComplexNDArray createComplex(int columns) {
  return createComplex(columns, order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Creates a complex ndarray with the specified shape
 *
 * @param rows    the rows of the ndarray
 * @param columns the columns of the ndarray
 * @param stride  the stride for the ndarray
 * @return the instance
 */
public static IComplexNDArray createComplex(int rows, int columns, int[] stride) {
  return createComplex(rows, columns, stride, order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Creates a complex ndarray with the specified shape
 *
 * @param shape  the shape of the ndarray
 * @param stride the stride for the ndarray
 * @return the instance
 */
public static IComplexNDArray createComplex(int[] shape, int[] stride) {
  return createComplex(shape, stride, order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Creates a complex ndarray with the specified shape
 *
 * @param rows    the rows of the ndarray
 * @param columns the columns of the ndarray
 * @return the instance
 */
public static IComplexNDArray createComplex(int rows, int columns) {
  return createComplex(rows, columns, order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Assigns the given matrix (put) to the specified slice
 *
 * @param slice the slice to assign
 * @param put   the slice to put
 * @return this for chainability
 */
@Override
public IComplexNDArray putSlice(int slice, INDArray put) {
  return putSlice(slice, Nd4j.createComplex(put));
}

代码示例来源:origin: deeplearning4j/nd4j

protected INDArray create(DataBuffer data, int[] shape, long offset) {
  if (this instanceof IComplexNDArray)
    return Nd4j.createComplex(data, shape, offset);
  else
    return Nd4j.create(data, shape, offset);
}

代码示例来源:origin: deeplearning4j/nd4j

protected INDArray create(DataBuffer data, int[] newShape, int[] newStrides, long offset, char ordering) {
  if (this instanceof IComplexNDArray)
    return Nd4j.createComplex(data, newShape, newStrides, offset, ordering);
  else
    return Nd4j.create(data, newShape, newStrides, offset, ordering);
}

代码示例来源:origin: deeplearning4j/nd4j

protected INDArray create(DataBuffer data, int[] newShape, int[] newStrides, long offset) {
  if (this instanceof IComplexNDArray)
    return Nd4j.createComplex(data, newShape, newStrides, offset);
  else
    return Nd4j.create(data, newShape, newStrides, offset);
}

代码示例来源:origin: deeplearning4j/nd4j

@Override
public IComplexNDArray linearViewColumnOrder() {
  if (length() >= Integer.MAX_VALUE)
    throw new IllegalArgumentException("Length can not be >= Integer.MAX_VALUE");
  return Nd4j.createComplex(data, new int[] {(int) length(), 1}, offset());
}

代码示例来源:origin: deeplearning4j/nd4j

protected INDArray create(int[] shape) {
  if (this instanceof IComplexNDArray)
    return Nd4j.createComplex(shape, getStrides(shape, Nd4j.order()), 0);
  else
    return Nd4j.create(shape, getStrides(shape, Nd4j.order()), 0);
}

代码示例来源:origin: deeplearning4j/nd4j

@Override
public IComplexNDArray hermitian() {
  IComplexNDArray result = Nd4j.createComplex(shape());
  IComplexDouble c = Nd4j.createDouble(0, 0);
  for (int i = 0; i < slices(); i++)
    for (int j = 0; j < columns(); j++)
      result.putScalar(j, i, getComplex(i, j, c).conji());
  return result;
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Computes the eigenvalues of a general matrix.
 */
public static IComplexNDArray eigenvalues(INDArray A) {
  assert A.rows() == A.columns();
  INDArray WR = Nd4j.create(A.rows(), A.rows());
  INDArray WI = WR.dup();
  Nd4j.getBlasWrapper().geev('N', 'N', A.dup(), WR, WI, dummy, dummy);
  return Nd4j.createComplex(WR, WI);
}

相关文章