Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-6697

PeriodicGraphCheckpointer is not clear edges.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 1.3.0
    • None
    • GraphX, MLlib
    • None

    Description

      When I run this branch(lrGraphxSGD) .
      PeriodicGraphCheckpointer only clear the vertices.

       
      def run(iterations: Int): Unit = {
          for (iter <- 1 to iterations) {
            logInfo(s"Start train (Iteration $iter/$iterations)")
            val margin = forward()
            margin.setName(s"margin-$iter").persist(storageLevel)
            println(s"train (Iteration $iter/$iterations) cost : ${error(margin)}")
            var gradient = backward(margin)
            gradient = updateDeltaSum(gradient, iter)
      
            dataSet = updateWeight(gradient, iter)
            dataSet.vertices.setName(s"vertices-$iter")
            dataSet.edges.setName(s"edges-$iter")
            dataSet.persist(storageLevel)
            graphCheckpointer.updateGraph(dataSet)
      
            margin.unpersist(blocking = false)
            gradient.unpersist(blocking = false)
            logInfo(s"End train (Iteration $iter/$iterations)")
            innerIter += 1
          }
          graphCheckpointer.deleteAllCheckpoints()
        }
      
        // Updater for L1 regularized problems
        private def updateWeight(delta: VertexRDD[Double], iter: Int): Graph[VD, ED] = {
          val thisIterStepSize = if (useAdaGrad) stepSize else stepSize / sqrt(iter)
          val thisIterL1StepSize = stepSize / sqrt(iter)
          val newVertices = dataSet.vertices.leftJoin(delta) { (_, attr, gradient) =>
            gradient match {
              case Some(gard) => {
                var weight = attr
                weight -= thisIterStepSize * gard
                if (regParam > 0.0 && weight != 0.0) {
                  val shrinkageVal = regParam * thisIterL1StepSize
                  weight = signum(weight) * max(0.0, abs(weight) - shrinkageVal)
                }
                assert(!weight.isNaN)
                weight
              }
              case None => attr
            }
          }
          GraphImpl(newVertices, dataSet.edges)
        }
      

      Attachments

        1. QQ20150403-1.png
          337 kB
          Guoqiang Li

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gq Guoqiang Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: