Package org.apache.mahout.math

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


     * as this significantly slows the learning.
     */
        NormalDistribution u = new NormalDistribution( this.randNumGenerator, 0, .01, fanIn() );

        Matrix weights = new DenseMatrix( this.numberVisibleNeurons, this.numberHiddenNeurons ); //Matrix.zeros(nVisible,nHidden);
        weights.assign(0.0);

        for (int i = 0; i < this.connectionWeights.numRows(); i++) {

            // TODO: figure out whats going on with the weights matrix
            //  weights.putRow(i,new Matrix(u.sample(this.W.columns)));
View Full Code Here


   * @return a new matrix with the target vector row added to each row
   */
  public static Matrix addRowVector(Matrix m, Vector row) {

    Matrix ret = m.like();
    ret.assign(m);

    for (int r = 0; r < m.numRows(); r++) {

      ret.viewRow(r).assign(row, Functions.PLUS);

View Full Code Here

  public void testEnsureValidOutcomeMatrix() {
   
    boolean caughtBad = false;
   
    Matrix bad = new DenseMatrix(2, 3);
    bad.assign(0.0);
   
    try {
      MatrixUtils.ensureValidOutcomeMatrix(bad);
    } catch (Exception e) {
      caughtBad = true;
View Full Code Here

    }
   
    assertEquals( true, caughtBad );
   
    Matrix good = new DenseMatrix(2, 3);
    good.assign(0.0);
    good.set(0, 1, 2.0);
   
    boolean caughtGood = false;
   
    try {
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.