本文整理汇总了Java中edu.stanford.nlp.util.MutableDouble.set方法的典型用法代码示例。如果您正苦于以下问题:Java MutableDouble.set方法的具体用法?Java MutableDouble.set怎么用?Java MutableDouble.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.stanford.nlp.util.MutableDouble
的用法示例。
在下文中一共展示了MutableDouble.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: iterate
import edu.stanford.nlp.util.MutableDouble; //导入方法依赖的package包/类
/**
* Iteration for lambda[index].
* Returns true if this lambda hasn't converged. A lambda is deemed
* converged if the change found for it is smaller then the parameter eps.
*/
boolean iterate(int index, double err, MutableDouble ret) {
double deltaL = 0.0;
deltaL = newton(deltaL, index, err);
//System.out.println("delta is "+deltaL+" feature "+index+" expectation "+ftildeArr[index]);
if (Math.abs(deltaL + lambda[index]) > 200) {
if ((deltaL + lambda[index]) > 200) {
deltaL = 200 - lambda[index];
} else {
deltaL = -lambda[index] - 200;
}
System.err.println("set delta to smth " + deltaL);
}
lambda[index] = lambda[index] + deltaL;
if (Double.isNaN(deltaL)) {
System.err.println(" NaN " + index + ' ' + deltaL);
}
ret.set(deltaL);
return (Math.abs(deltaL) >= eps);
}
示例2: iterate
import edu.stanford.nlp.util.MutableDouble; //导入方法依赖的package包/类
/**
* Iteration for lambda[index].
* Returns true if this lambda hasn't converged. A lambda is deemed
* converged if the change found for it is smaller then the parameter eps.
*/
boolean iterate(int index, double err, MutableDouble ret) {
double deltaL = 0.0;
deltaL = newton(deltaL, index, err);
//System.err.println("delta is "+deltaL+" feature "+index+" expectation "+ftildeArr[index]);
if (Math.abs(deltaL + lambda[index]) > 200) {
if ((deltaL + lambda[index]) > 200) {
deltaL = 200 - lambda[index];
} else {
deltaL = -lambda[index] - 200;
}
System.err.println("set delta to smth " + deltaL);
}
lambda[index] = lambda[index] + deltaL;
if (Double.isNaN(deltaL)) {
System.err.println(" NaN " + index + ' ' + deltaL);
}
ret.set(deltaL);
return (Math.abs(deltaL) >= eps);
}
示例3: iterate
import edu.stanford.nlp.util.MutableDouble; //导入方法依赖的package包/类
/**
* Iteration for lambda[index].
*
* @return true if this lambda hasn't converged.
*/
@SuppressWarnings({"UnusedDeclaration"})
boolean iterate(int index, double err, MutableDouble ret) {
double deltaL = 0.0;
deltaL = newton(deltaL, index, err);
lambda[index] = lambda[index] + deltaL;
if (!(deltaL == deltaL)) {
System.err.println(" NaN " + index + ' ' + deltaL);
}
ret.set(deltaL);
return (Math.abs(deltaL) >= eps);
}