Examples of viewPart()


Examples of org.apache.mahout.math.Vector.viewPart()

              : rowCount, 1);
      } else if (aCols[col].size() < rowCount) {
        Vector newVec =
          new SequentialAccessSparseVector(rowCount + blockHeight,
                                           aCols[col].getNumNondefaultElements() << 1);
        newVec.viewPart(0, aCols[col].size()).assign(aCols[col]);
        aCols[col] = newVec;
      }
    }

    @Override
View Full Code Here

Examples of org.apache.mahout.math.Vector.viewPart()

                                           1);
      } else if (aCols[col].size() < rowCount) {
        Vector newVec =
          new SequentialAccessSparseVector(rowCount << 1,
                                           aCols[col].getNumNondefaultElements() << 1);
        newVec.viewPart(0, aCols[col].size()).assign(aCols[col]);
        aCols[col] = newVec;
      }
    }

    @Override
View Full Code Here

Examples of org.apache.mahout.math.Vector.viewPart()

    input = readCsv("sgd.csv");

    // regenerate the target variable
    Vector target = new DenseVector(60);
    target.assign(0);
    target.viewPart(30, 30).assign(1);
    return target;
  }

  private static void train(Matrix input, Vector target, OnlineLearner lr) {
    RandomUtils.useTestSeed();
View Full Code Here

Examples of org.apache.mahout.math.Vector.viewPart()

    Vector result = classifyNoLink(instance);
    // Find the max value's index.
    int max = result.maxValueIndex();
    result.assign(0);
    result.setQuick(max, 1.0);
    return result.viewPart(1, result.size() - 1);
  }

  @Override
  public Vector classifyNoLink(Vector instance) {
    DenseVector hidden = inputToHidden(instance);
View Full Code Here

Examples of org.apache.mahout.math.Vector.viewPart()

    input = readCsv("sgd.csv");

    // regenerate the target variable
    Vector target = new DenseVector(60);
    target.assign(0);
    target.viewPart(30, 30).assign(1);
    return target;
  }

  static void train(Matrix input, Vector target, OnlineLearner lr) {
    RandomUtils.useTestSeed();
View Full Code Here

Examples of org.apache.mahout.math.Vector.viewPart()

    // Convert to probabilities by exponentiation.
    double max = result.maxValue();
    result.assign(Functions.minus(max)).assign(Functions.EXP);
    result = result.divide(result.norm(1));

    return result.viewPart(1, result.size() - 1);
  }

  @Override
  public Vector classifyNoLink(Vector instance) {
    Vector result = new DenseVector(weights.numRows());
View Full Code Here

Examples of org.apache.mahout.math.Vector.viewPart()

              : rowCount, 1);
      } else if (aCols[col].size() < rowCount) {
        Vector newVec =
          new SequentialAccessSparseVector(rowCount + blockHeight,
                                           aCols[col].getNumNondefaultElements() << 1);
        newVec.viewPart(0, aCols[col].size()).assign(aCols[col]);
        aCols[col] = newVec;
      }
    }

    @Override
View Full Code Here

Examples of org.apache.mahout.math.Vector.viewPart()

                                           1);
      } else if (aCols[col].size() < rowCount) {
        Vector newVec =
          new SequentialAccessSparseVector(rowCount << 1,
                                           aCols[col].getNumNondefaultElements() << 1);
        newVec.viewPart(0, aCols[col].size()).assign(aCols[col]);
        aCols[col] = newVec;
      }
    }

    @Override
View Full Code Here

Examples of org.apache.mahout.math.Vector.viewPart()

    input = readCsv("sgd.csv");

    // regenerate the target variable
    Vector target = new DenseVector(60);
    target.assign(0);
    target.viewPart(30, 30).assign(1);
    return target;
  }

  private static void train(Matrix input, Vector target, OnlineLearner lr) {
    RandomUtils.useTestSeed();
View Full Code Here

Examples of org.apache.mahout.math.matrix.DoubleMatrix2D.viewPart()

        for (int j = 0; j < nx; j++) {
          X.setQuick(i, j, X.getQuick(i, j) - X.getQuick(k, j) * QR.getQuick(i, k));
        }
      }
    }
    return X.viewPart(0, 0, n, nx);
  }

  /**
   * Returns a String with (propertyName, propertyValue) pairs. Useful for debugging or to quickly get the rough
   * picture. For example,
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.