Package net.myrrix.online.factorizer.als

Examples of net.myrrix.online.factorizer.als.AlternatingLeastSquares


          System.getProperty("model.als.iterations.convergenceThreshold",
                             Double.toString(AlternatingLeastSquares.DEFAULT_CONVERGENCE_THRESHOLD));
      String maxIterationsString =
          System.getProperty("model.iterations.max",
                             Integer.toString(AlternatingLeastSquares.DEFAULT_MAX_ITERATIONS));   
      MatrixFactorizer als = new AlternatingLeastSquares(rbyRow,
                                                         rbyColumn,
                                                         features,
                                                         Double.parseDouble(iterationsConvergenceString),
                                                         Integer.parseInt(maxIterationsString));
 
      if (currentGeneration != null) {
        FastByIDMap<float[]> previousY = currentGeneration.getY();
        if (previousY != null) {
          FastByIDMap<float[]> previousYClone;
          Lock yLock = currentGeneration.getYLock().readLock();
          yLock.lock();
          try {
            previousYClone = new FastByIDMap<float[]>(previousY.size());
            for (FastByIDMap.MapEntry<float[]> entry : previousY.entrySet()) {
              previousYClone.put(entry.getKey(), entry.getValue().clone());
            }
          } finally {
            yLock.unlock();
          }
          als.setPreviousY(previousYClone);
        }
      }
 
      try {
        als.call();
        log.info("Factorization complete");
      } catch (ExecutionException ee) {
        throw new IOException(ee.getCause());
      } catch (InterruptedException ignored) {
        log.warn("ALS computation was interrupted");
View Full Code Here

TOP

Related Classes of net.myrrix.online.factorizer.als.AlternatingLeastSquares

Copyright © 2018 www.massapicom. 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.