Examples of SparseMatrix


Examples of org.fnlp.ml.types.sv.SparseMatrix

    }
  }

  public static void main(String[] args) {
    int[] dim = { 10, 10 };
    SparseMatrix matrix = new SparseMatrix(dim);
    Vector<int[]> vec = new Vector();
    for (int i = 0; i < dim[0]; i++)
      for (int j = 0; j < dim[1]; j++) {
        int[] indices = { j, i };
        vec.add(indices);
      }
    for (int i = 0; i < vec.size(); i++) {
      matrix.set(vec.get(i), i);
    }
    System.out.print("矩阵初始化结束\n");
    Long startTime = System.currentTimeMillis();
    Nmf nmf = new Nmf(1000, 0.0001f, 5, matrix);
    nmf.calc();
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.