本文整理了Java中org.apache.mahout.math.Vector.incrementQuick()
方法的一些代码示例,展示了Vector.incrementQuick()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.incrementQuick()
方法的具体详情如下:
包路径:org.apache.mahout.math.Vector
类名称:Vector
方法名:incrementQuick
[英]Increment the value at the given index by the given value.
[中]将给定索引处的值增加给定值。
代码示例来源:origin: apache/mahout
@Override
public void incrementQuick(int index, double increment) {
delegate.incrementQuick(index, increment);
}
代码示例来源:origin: apache/mahout
@Override
public void incrementQuick(int index, double increment) {
delegate.incrementQuick(index, increment);
}
代码示例来源:origin: org.apache.mahout/mahout-math
@Override
public void incrementQuick(int index, double increment) {
delegate.incrementQuick(index, increment);
}
代码示例来源:origin: org.apache.mahout/mahout-math
@Override
public void incrementQuick(int index, double increment) {
delegate.incrementQuick(index, increment);
}
代码示例来源:origin: org.apache.mahout/mahout-mrlegacy
@Override
public void train(long trackingKey, String groupKey, int actual, Vector instance) {
unseal();
double learningRate = currentLearningRate();
// push coefficients back to zero based on the prior
regularize(instance);
// update each row of coefficients according to result
Vector gradient = this.gradient.apply(groupKey, actual, instance, this);
for (int i = 0; i < numCategories - 1; i++) {
double gradientBase = gradient.get(i);
// then we apply the gradientBase to the resulting element.
for (Element updateLocation : instance.nonZeroes()) {
int j = updateLocation.index();
double newValue = beta.getQuick(i, j) + gradientBase * learningRate * perTermLearningRate(j) * instance.get(j);
beta.setQuick(i, j, newValue);
}
}
// remember that these elements got updated
for (Element element : instance.nonZeroes()) {
int j = element.index();
updateSteps.setQuick(j, getStep());
updateCounts.incrementQuick(j, 1);
}
nextStep();
}
代码示例来源:origin: org.apache.mahout/mahout-mr
@Override
public void train(long trackingKey, String groupKey, int actual, Vector instance) {
unseal();
double learningRate = currentLearningRate();
// push coefficients back to zero based on the prior
regularize(instance);
// update each row of coefficients according to result
Vector gradient = this.gradient.apply(groupKey, actual, instance, this);
for (int i = 0; i < numCategories - 1; i++) {
double gradientBase = gradient.get(i);
// then we apply the gradientBase to the resulting element.
for (Element updateLocation : instance.nonZeroes()) {
int j = updateLocation.index();
double newValue = beta.getQuick(i, j) + gradientBase * learningRate * perTermLearningRate(j) * instance.get(j);
beta.setQuick(i, j, newValue);
}
}
// remember that these elements got updated
for (Element element : instance.nonZeroes()) {
int j = element.index();
updateSteps.setQuick(j, getStep());
updateCounts.incrementQuick(j, 1);
}
nextStep();
}
代码示例来源:origin: org.apache.mahout/mahout-core
@Override
public void train(long trackingKey, String groupKey, int actual, Vector instance) {
unseal();
double learningRate = currentLearningRate();
// push coefficients back to zero based on the prior
regularize(instance);
// update each row of coefficients according to result
Vector gradient = this.gradient.apply(groupKey, actual, instance, this);
for (int i = 0; i < numCategories - 1; i++) {
double gradientBase = gradient.get(i);
// then we apply the gradientBase to the resulting element.
for (Element updateLocation : instance.nonZeroes()) {
int j = updateLocation.index();
double newValue = beta.getQuick(i, j) + gradientBase * learningRate * perTermLearningRate(j) * instance.get(j);
beta.setQuick(i, j, newValue);
}
}
// remember that these elements got updated
for (Element element : instance.nonZeroes()) {
int j = element.index();
updateSteps.setQuick(j, getStep());
updateCounts.incrementQuick(j, 1);
}
nextStep();
}
内容来源于网络,如有侵权,请联系作者删除!