@Override public double doubleValue() { return getval(); }
public boolean equals(Object obj) { if (this == obj) { return true; } if ( ! (obj instanceof DoubleAD)) { return false; } DoubleAD b = (DoubleAD) obj; return b.getval() == val && b.getdot() == dot; }
public void plusEquals(DoubleAD a){ setval(val + a.getval() ); setdot(dot + a.getdot() ); }
return new DoubleAD(Double.NEGATIVE_INFINITY,Double.NEGATIVE_INFINITY); int maxIdx = fromIndex; double max = logInputs[fromIndex].getval(); double maxdot = logInputs[fromIndex].getdot(); if (logInputs[i].getval() > max) { maxIdx = i; maxdot = logInputs[i].getdot(); max = logInputs[i].getval(); if (i != maxIdx && logInputs[i].getval() > cutoff) { haveTerms = true; double curEXP = Math.exp(logInputs[i].getval() - max); intermediate += curEXP; intermediateDot += curEXP*logInputs[i].getdot();
public void minusEquals(DoubleAD a){ setval(val - a.getval() ); setdot(dot - a.getdot() ); }
public static DoubleAD divideConst(DoubleAD a, double b){ DoubleAD c = new DoubleAD(); c.setval(a.getval()/b); c.setdot( a.getdot()/b ); return c; }
public static DoubleAD multConst(DoubleAD a,double b){ DoubleAD c = new DoubleAD(); c.setval( a.getval() * b ); c.setdot(a.getdot()*b); return c; }
public static DoubleAD plusConst( DoubleAD a,double b){ DoubleAD c = new DoubleAD(); c.setval( a.getval() + b ); c.setdot( a.getdot()); return c; }
public static DoubleAD minusConst( DoubleAD a,double b){ DoubleAD c = new DoubleAD(); c.setval( a.getval() - b ); c.setdot( a.getdot()); return c; }
double dV = sums[labels[m]].getval() - total.getval(); if (dataWeights != null) { dV *= dataWeights[d]; tmp[i] = derivativeAD[i].getval(); derivativeAD[i].plusEquals(ADMath.multConst(xAD[i], batch.length/(data.length * prior.getSigma()*prior.getSigma()))); derivative[i] = derivativeAD[i].getval(); HdotV[i] = derivativeAD[i].getdot();
public void plusEquals(DoubleAD a){ setval(val + a.getval() ); setdot(dot + a.getdot() ); }
public static DoubleAD divideConst(DoubleAD a, double b){ DoubleAD c = new DoubleAD(); c.setval(a.getval()/b); c.setdot( a.getdot()/b ); return c; }
public static DoubleAD plusConst( DoubleAD a,double b){ DoubleAD c = new DoubleAD(); c.setval( a.getval() + b ); c.setdot( a.getdot()); return c; }