Examples of dot()


Examples of org.apache.mahout.math.Vector.dot()

      state.getHelperVector().set(i, 0);
    }
    if (debug && currentPseudoEigen.norm(2) > 0) {
      for (int i = 0; i < state.getNumEigensProcessed(); i++) {
        Vector previousEigen = previousEigens.getRow(i);
        log.info("dot with previous: {}", (previousEigen.dot(currentPseudoEigen)) / currentPseudoEigen.norm(2));
      }
    }
    /*
     * Step 3: verify how eigen-like the prospective eigen is.  This is potentially asynchronous.
     */
 
View Full Code Here

Examples of org.apache.mahout.math.Vector.dot()

 
  @Override
  public double pdf(VectorWritable v) {
    Vector x = v.get();
    double sd2 = stdDev * stdDev;
    double exp = -(x.dot(x) - 2 * x.dot(mean) + mean.dot(mean)) / (2 * sd2);
    double ex = Math.exp(exp);
    return ex / (stdDev * sqrt2pi);
  }
 
  @Override
View Full Code Here

Examples of org.apache.mahout.math.Vector.dot()

 
  @Override
  public double pdf(VectorWritable v) {
    Vector x = v.get();
    double sd2 = stdDev * stdDev;
    double exp = -(x.dot(x) - 2 * x.dot(mean) + mean.dot(mean)) / (2 * sd2);
    double ex = Math.exp(exp);
    return ex / (stdDev * sqrt2pi);
  }
 
  @Override
View Full Code Here

Examples of org.apache.mahout.matrix.Vector.dot()

  public double distance(Vector v1, Vector v2) {
    if (v1.size() != v2.size()) {
      throw new CardinalityException();
    }
    Vector vector = v1.minus(v2);
    return vector.dot(vector);
  }

  @Override
  public double distance(double centroidLengthSquare, Vector centroid, Vector v) {
    if (centroid.size() != v.size()) {
View Full Code Here

Examples of org.ejml.simple.SimpleMatrix.dot()

      if (op.testOptions.verbose) {
        System.err.println(error);
      }
      throw new NoSuchParseException(error);
    }
    double score = scoreW.dot(currentVector);
    //score = NeuralUtils.sigmoid(score);
    scores.put(tree, score);
    //System.err.print(Double.toString(score)+" ");
  }
View Full Code Here

Examples of org.jblas.DoubleMatrix.dot()

    double margin = weightsVector.dot(featuresVector);

    double labelAsDouble = label ? 1.0 : -1.0;
    if (margin * labelAsDouble < 1) {

      double confidence = featuresVector.dot(featuresVector.mmul(varianceMatrix));

      double beta = 1 / (confidence + this.r);
      double alpha = Math.max(0, beta * (1 - labelAsDouble * margin));
      DoubleMatrix delta = featuresVector.mmul(varianceMatrix).mul(alpha * labelAsDouble);

 
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.dot()

      private void setSphere(Vector3D O, Vector3D A, Vector3D B) {
          Vector3D a = A.getSubtracted(O);
          Vector3D b = B.getSubtracted(O);
          Vector3D acrossB = a.getCross(b);

          float Denominator = 2.0f * acrossB.dot(acrossB);

          if (Denominator == 0) {
              center.setXYZ(0, 0, 0);
              radius = 0;
          } else {
View Full Code Here

Examples of org.osm2world.core.math.VectorXZ.dot()

        //  as getDirection returns vectors whose length is 1
        //- we don't need to actually calculate the angle itself,
        //  because if angle a > angle b, then cos a < cos b
        //  (in [0°, 180°])
       
        double comparison = d1.dot(X_UNIT) - d2.dot(X_UNIT);
       
        if (comparison == 0) {
          return 0;
        }
       
View Full Code Here

Examples of processing.core.PVector.dot()

 
  public boolean detect(MassedBeing being1, MassedBeing being2) {
    if(being1 == being2) // no self-interaction
      return false;
    PVector r = PVector.sub(being1.getPosition(), being2.getPosition());
    float d_squared = r.dot(r);
    // check if the distance is within the maximum range
    return d_squared <= _maxRangeSquared && d_squared != 0;
  }

  public void handle(MassedBeing being1, MassedBeing being2) {
View Full Code Here

Examples of processing.core.PVector.dot()

  }

  public void handle(MassedBeing being1, MassedBeing being2) {
    // F = k * q1 * q2 / r^2
    PVector r = PVector.sub(being2.getPosition(), being1.getPosition());
    double d_squared = (double)r.dot(r);
    double F = _k * beingFactor(being1) * beingFactor(being2) / d_squared;
    r.normalize();
    PVector force = PVector.mult(r, (float)F);
    being2.addForce(force);
    being1.addForce(reverse(force));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.