Esempio n. 1
0
 public void observe(Vector x, double weight) {
   if (weight == 1.0) {
     observe(x);
   } else {
     setS0(getS0() + weight);
     Vector weightedX = x.times(weight);
     if (getS1() == null) {
       setS1(weightedX);
     } else {
       getS1().assign(weightedX, Functions.PLUS);
     }
     Vector x2 = x.times(x).times(weight);
     if (getS2() == null) {
       setS2(x2);
     } else {
       getS2().assign(x2, Functions.PLUS);
     }
   }
 }
Esempio n. 2
0
 @Override
 public void observe(VectorWritable x, double weight) {
   observe(x.get(), weight);
 }
Esempio n. 3
0
 @Override
 public void observe(VectorWritable x) {
   observe(x.get());
 }