Package org.apache.mahout.math

Examples of org.apache.mahout.math.Matrix.plus()


    assertEquals(0, m.minus(a).aggregate(Functions.PLUS, Functions.ABS), 1.0e-10);
    print(m);

    assertEquals(0, m.transpose().times(m).minus(a.transpose().times(a)).aggregate(
        Functions.PLUS, Functions.ABS), 1.0e-10);
    assertEquals(0, m.plus(m).minus(a.plus(a)).aggregate(Functions.PLUS, Functions.ABS), 1.0e-10);
  }

  private static void print(Matrix m) {
    for (int i = 0; i < m.rowSize(); i++) {
      for (int j = 0; j < m.columnSize(); j++) {
View Full Code Here


   *          existing matrices.
   */
  public void updateWeightMatrices(Matrix[] matrices) {
    for (int i = 0; i < matrices.length; ++i) {
      Matrix matrix = this.weightMatrixList.get(i);
      this.weightMatrixList.set(i, matrix.plus(matrices[i]));
    }
  }

  /**
   * Set the weight matrices.
View Full Code Here

   *          existing matrices.
   */
  public void updateWeightMatrices(Matrix[] matrices) {
    for (int i = 0; i < matrices.length; ++i) {
      Matrix matrix = weightMatrixList.get(i);
      weightMatrixList.set(i, matrix.plus(matrices[i]));
    }
  }

  /**
   * Set the weight matrices.
View Full Code Here

    }

    numIterations++;
   
   
    this.adjustedGradient = MatrixUtils.div(this.gradient,MatrixUtils.sqrt(gradientSquared.plus(fudgeFactor)));
        this.adjustedGradient = this.adjustedGradient.times(masterStepSize);
    //ensure no zeros
//    this.adjustedGradient.addi(1e-6);
    this.adjustedGradient = this.adjustedGradient.plus( 1e-6 );
   
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.