Package org.ejml.simple

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


   * Applies the derivative of tanh to each of the elements in the vector.  Returns a new matrix.
   */
  public static SimpleMatrix elementwiseApplyTanhDerivative(SimpleMatrix input) {
    SimpleMatrix output = new SimpleMatrix(input.numRows(), input.numCols());
    output.set(1.0);
    output = output.minus(input.elementMult(input));
    return output;
  }

  /**
   * Concatenates several column vectors into one large column
View Full Code Here


        SimpleMatrix C = subC.extract();

        if( operationType > 0 )
            return A.mult(B).plus(C).getMatrix();
        else if( operationType < 0 )
            return C.minus(A.mult(B)).getMatrix();
        else
            return A.mult(B).getMatrix();
    }

View Full Code Here

        SimpleMatrix R = SimpleMatrix.wrap(alg.getR(null,true));

        SimpleMatrix A_found = Q.mult(R);
        SimpleMatrix A = SimpleMatrix.wrap(orig);

        return A.minus(A_found).normF()/A.normF();
    }

    public static double evaluate( QRPDecomposition<DenseMatrix64F> alg , DenseMatrix64F orig ) {

        double maxValue = CommonOps.elementMaxAbs(orig);
View Full Code Here

      for (int sample = 0; sample < noTrainingExamples; sample++) {
       
        SimpleMatrix vector = datasetMatrix.extractVector(true, sample);
       
        for (int centroid = 0; centroid < noCentroids; centroid++) {
          distanceMatrix = vector.minus(centroidMatrix[centroid]);
          distanceMatrix = distanceMatrix.elementMult(distanceMatrix);
          distanceWithCentroid = distanceMatrix.elementSum() / noFeatures;
         
          if (centroid == 0) {
            selectedCentroid = 0;
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.