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

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

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

Nd4j.createFloat介绍

[英]Create double
[中]创造双重

代码示例

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

UNIT = Nd4j.createFloat(1, 0);
ZERO = Nd4j.createFloat(0, 0);
NEG_UNIT = Nd4j.createFloat(-1, 0);
ENFORCE_NUMERICAL_STABILITY = pp.toBoolean(NUMERICAL_STABILITY);
DISTRIBUTION_FACTORY = distributionFactoryClazz.newInstance();

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

/**
 * Returns the exp of a complex number:
 * Let r be the realComponent component and i be the imaginary
 * Let ret be the complex number returned
 * ret -> exp(r) * cos(i), exp(r) * sin(i)
 * where the first number is the realComponent component
 * and the second number is the imaginary component
 *
 * @param d the number to getFromOrigin the exp of
 * @return the exponential of this complex number
 */
public static IComplexFloat exp(IComplexFloat d) {
  return Nd4j.createFloat((float) FastMath.exp(d.realComponent()) * (float) FastMath.cos(d.imaginaryComponent()),
          (float) FastMath.exp(d.realComponent()) * (float) FastMath.sin(d.imaginaryComponent()));
}

代码示例来源:origin: org.nd4j/nd4j-jcublas-common

/**
 * Create a complex float from a cuda float
 *
 * @param cuComplex the cuda float to convert
 * @return the create float
 */
public static IComplexFloat toCuFloat(cuComplex cuComplex) {
  return Nd4j.createFloat(cuComplex.x, cuComplex.y);
}

代码示例来源:origin: org.nd4j/nd4j-java

@Override
  public IComplexNumber dup() {
    return Nd4j.createFloat(real,imag);
  }
}

代码示例来源:origin: org.nd4j/nd4j-netlib-blas

/**
 * Convert to a float
 *
 * @return this complex number as a float
 */
@Override
public IComplexFloat asFloat() {
  return Nd4j.createFloat((float) real(), (float) imag());
}

代码示例来源:origin: org.nd4j/nd4j-x86

/**
 * Convert to a float
 *
 * @return this complex number as a float
 */
@Override
public IComplexFloat asFloat() {
  return Nd4j.createFloat((float) real(), (float) imag());
}

代码示例来源:origin: org.nd4j/nd4j-jcublas-common

@Override
public IComplexFloat getComplexFloat(int i) {
  return Nd4j.createFloat(getFloat(i), getFloat(i + 1));
}

代码示例来源:origin: org.nd4j/nd4j-cuda-7.5

@Override
public IComplexFloat getComplexFloat(long i) {
  return Nd4j.createFloat(getFloat(i), getFloat(i + 1));
}

代码示例来源:origin: org.nd4j/nd4j-api

UNIT = Nd4j.createFloat(1, 0);
ZERO = Nd4j.createFloat(0, 0);
NEG_UNIT = Nd4j.createFloat(-1, 0);
ENFORCE_NUMERICAL_STABILITY =
    Boolean.parseBoolean(System.getProperty(NUMERICAL_STABILITY, String.valueOf(false)));

代码示例来源:origin: org.nd4j/nd4j-api

/**
 * Returns the exp of a complex number:
 * Let r be the realComponent component and i be the imaginary
 * Let ret be the complex number returned
 * ret -> exp(r) * cos(i), exp(r) * sin(i)
 * where the first number is the realComponent component
 * and the second number is the imaginary component
 *
 * @param d the number to getFromOrigin the exp of
 * @return the exponential of this complex number
 */
public static IComplexFloat exp(IComplexFloat d) {
  return Nd4j.createFloat((float) FastMath.exp(d.realComponent()) * (float) FastMath.cos(d.imaginaryComponent()),
          (float) FastMath.exp(d.realComponent()) * (float) FastMath.sin(d.imaginaryComponent()));
}

相关文章