double convergence,
int maxNumPasses,
int desiredRank,
TrainingState state) {
HebbianUpdater updater = new HebbianUpdater();
AsyncEigenVerifier verifier = new AsyncEigenVerifier();
HebbianSolver solver = new HebbianSolver(updater,
verifier,
convergence,
maxNumPasses);
long start = System.nanoTime();
TrainingState finalState = solver.solve(corpus, desiredRank);
assertNotNull(finalState);
state.setCurrentEigens(finalState.getCurrentEigens());
state.setCurrentEigenValues(finalState.getCurrentEigenValues());
long time = 0L;
time += System.nanoTime() - start;
verifier.close();
assertEquals(state.getCurrentEigens().numRows(), desiredRank);
return time / 1000000L;
}