本文整理匯總了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);
}