本文整理汇总了Java中org.nd4j.linalg.api.ndarray.INDArray.getFloat方法的典型用法代码示例。如果您正苦于以下问题:Java INDArray.getFloat方法的具体用法?Java INDArray.getFloat怎么用?Java INDArray.getFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.nd4j.linalg.api.ndarray.INDArray
的用法示例。
在下文中一共展示了INDArray.getFloat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: State
import org.nd4j.linalg.api.ndarray.INDArray; //导入方法依赖的package包/类
/**
* @param velocityVector The velocity vector to extract the velocity components from.
* @param flatKick The flat-kick strength as a percentage (between 0 and 1).
* @param chipKick The chip-kick strength as a percentage (between 0 and 1).
* @param dribblerSpin The dribbler spin as a percentage with the sign indicating the
* direction of spin (between -1 and 1)
*/
public State(
final INDArray velocityVector,
final float flatKick,
final float chipKick,
final float dribblerSpin
) {
this(
velocityVector.getFloat(0, 0),
velocityVector.getFloat(1, 0),
velocityVector.getFloat(2, 0),
flatKick,
chipKick,
dribblerSpin);
}
示例2: getMaxValueIndex
import org.nd4j.linalg.api.ndarray.INDArray; //导入方法依赖的package包/类
private static int getMaxValueIndex(INDArray indArray) {
int maxIndex = 0;
float maxValue = Float.MIN_VALUE;
for (int i = 0; i < indArray.columns(); i++) {
float value = indArray.getFloat(i);
if (maxValue <= value) {
maxValue = value;
maxIndex = i;
}
}
return maxIndex;
}
示例3: normalize
import org.nd4j.linalg.api.ndarray.INDArray; //导入方法依赖的package包/类
/** @return {@link INDArray} */
INDArray normalize(INDArray array) {
INDArray norm = array.norm2(1);
for (int i = 0; i < norm.size(0); i++) {
for (int j = 0; j < norm.size(1); j++) {
if (norm.getFloat(i) == 0) norm.put(i, j, 1.0);
}
}
return array.diviColumnVector(norm);
}