Package org.apache.mahout.math

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


     
    }
   
    Matrix twos = ones.plus(ones_alt);

    for ( int r = 0; r < twos.numRows(); r++ ) {
     
      for ( int c = 0; c < twos.numCols(); c++ ) {
       
        assertEquals(2.0, twos.getQuick(r, c), 0.0);
       
View Full Code Here


   
    RandomGenerator g = new MersenneTwister(123);
   
    Matrix u = MatrixUtils.uniform(g, 3, 4);
   
    assertEquals(3, u.numRows());
    assertEquals(4, u.numCols());
   
  }
 
  @Test
View Full Code Here

   
    public static Matrix rand(int rows, int columns) {
        Matrix m = new DenseMatrix(rows, columns);

        java.util.Random rndGen = new java.util.Random();
        for ( int r = 0; r < m.numRows(); r++ ) {
         
          for ( int c = 0; c < m.numCols(); c++ ) {
           
            m.setQuick( r, c, rndGen.nextDouble() );
           
View Full Code Here



        MatrixUtils.subi(logisticRegressionLayer.connectionWeights,logLayerGradient);

        int biasGradientLength = biasGradient.numCols() * biasGradient.numRows();
        int biasTermsLength = logisticRegressionLayer.biasTerms.numRows() * logisticRegressionLayer.biasTerms.numCols();
        if(biasGradientLength != biasTermsLength)
            MatrixUtils.subi(logisticRegressionLayer.biasTerms,MatrixUtils.mean(biasGradient));
        else {
            double mean = MatrixUtils.mean(biasGradient);
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.