Examples of dotProduct()


Examples of org.fnlp.ml.types.sv.ISparseVector.dotProduct()

      oracle = new Predict<Integer>(n);
    }

    for (int i = 0; i < ysize; i++) {
      ISparseVector fv = generator.getVector(inst, i);
      float score = fv.dotProduct(weights);
      if (target != null && target == i)
        oracle.add(i,score);
      else
        pred.add(i,score);
    }
View Full Code Here

Examples of org.jquantlib.math.matrixutilities.Array.dotProduct()

            x_ = lineSearch_.lastX();
            // New function value
            P.setFunctionValue(lineSearch_.lastFunctionValue());
            // New gradient and search direction vectors
            gdiff = gold.sub(lineSearch_.lastGradient());
            normdiff = Math.sqrt(gdiff.dotProduct(gdiff));
            gold = lineSearch_.lastGradient();
            lineSearch_.setSearchDirection(gold.mul(-1));
            // New gradient squared norm
            P.setGradientNormValue(lineSearch_.lastGradientNormNorm2());
View Full Code Here

Examples of org.jquantlib.math.matrixutilities.Array.dotProduct()

        // compute its values
        lsp_.targetAndValue(x, target, fct2fit);
        // do the difference
        final Array diff = target.sub(fct2fit);
        // and compute the scalar product (square of the norm)
        return diff.dotProduct(diff);
    }

    @Override
    public void gradient(final Array grad_f, final Array x) {
        // size of target and function to fit vectors
View Full Code Here

Examples of org.jquantlib.math.matrixutilities.Array.dotProduct()

        final Array diff = target.sub(fct2fit);
        // compute derivative
        // FIXME: transpost implementation ?!!!!!!!!!!!!!!
        // grad_f = -2.0*(transpose(grad_fct2fit)*diff);
        // and compute the scalar product (square of the norm)
        return diff.dotProduct(diff);
    }

    @Override
    public Array values(final Array x) {
        throw new UnsupportedOperationException("Work in progress");
View Full Code Here

Examples of org.jquantlib.math.matrixutilities.Array.dotProduct()

        }
    center.mulAssign(1.0 / vertices.size());
    double result = 0;
    for (int i = 0; i < vertices.size(); ++i) {
      final Array temp = vertices.get(i).sub(center);
      result += Math.sqrt(temp.dotProduct(temp));
    }
    return result / vertices.size();
  }

  public double extrapolate(final Problem P, final int iHighest, double factor) {
View Full Code Here

Examples of weka.core.pmml.VectorInstance.dotProduct()

     * @throws Exception if something goes wrong
     */
    public double evaluate(VectorInstance x, VectorInstance y)
    throws Exception {
      VectorInstance diff = x.subtract(y);
      double result = -m_gamma * diff.dotProduct(diff);

      return Math.exp(result);   
    }

    /**
 
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.