Skip to content

Commit

Permalink
checkpoint products 3,6,9 ...
Browse files Browse the repository at this point in the history
  • Loading branch information
witgo committed Jul 30, 2014
1 parent 154dccf commit ea25033
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class ALS private (
rank, lambda, alpha, YtY)
previousProducts.unpersist()
logInfo("Re-computing U given I (Iteration %d/%d)".format(iter, iterations))
if (sc.checkpointDir.isDefined && (iter % 3 == 1)) {
if (sc.checkpointDir.isDefined && (iter % 3 == 0)) {
products.checkpoint()
}
products.setName(s"products-$iter").persist()
Expand All @@ -271,7 +271,7 @@ class ALS private (
logInfo("Re-computing I given U (Iteration %d/%d)".format(iter, iterations))
products = updateFeatures(numProductBlocks, users, userOutLinks, productInLinks,
rank, lambda, alpha, YtY = None)
if (sc.checkpointDir.isDefined && (iter % 3 == 1)) {
if (sc.checkpointDir.isDefined && (iter % 3 == 0)) {
products.checkpoint()
}
products.setName(s"products-$iter")
Expand Down

0 comments on commit ea25033

Please sign in to comment.