YitaoLiang / Scala-LearnPsdd

Learning the Structure of Probabilistic Sentential Decision Diagrams. https://web.cs.ucla.edu/~yliang/papers/uai2017.pdf
7 stars 5 forks source link

Run check function error #1

Open shiruizhao opened 4 years ago

shiruizhao commented 4 years ago

Hello, following the check instruction in manual.pdf, it report error shown below. the dataset is cloned from: https://github.com/UCLA-StarAI/Density-Estimation-Datasets Circuit-Model-Zoo is cloned from: https://github.com/UCLA-StarAI/Circuit-Model-Zoo ''' java -jar target/scala-2.11/psdd.jar check -d ./Density-Estimation-Datasets/datasets/accidents/accidents.train.data -v ./Circuit-Model-Zoo/vtrees/accidents.vtree -p ./Circuit-Model-Zoo/psdds/accidents.psdd '''

YitaoLiang commented 4 years ago

Hi, What is the error? It is missing from your issue report.

shiruizhao commented 4 years ago

Sorry. For debug, I add the println in the PsddManger.scala.

        case posLiteral(id, vtreeId, v) => println("pos literal", id, vtreeId, v)
          val vtreeNode = vtree.get(vtreeId.toInt)
          println("vtreeNode.asInstanceOf[VtreeInternalVar].v", vtreeNode.asInstanceOf[VtreeInternalVar].v)
          require(vtreeNode.asInstanceOf[VtreeInternalVar].v == v.toInt)

The missing log shows below. It seems like the vtree file isn't match up with the psdd file, but I don't know why.

Prepare psdd manager... done!
Read data... done!
Read Psdd from ../Circuit-Model-Zoo/psdds/accidents.psdd...(pos literal,0,0,11)
(vtreeNode.asInstanceOf[VtreeInternalVar].v,8)
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed
    at scala.Predef$.require(Predef.scala:212)
    at operations.PsddManager$$anonfun$readPsdd$1.apply(PsddManager.scala:1133)
    at operations.PsddManager$$anonfun$readPsdd$1.apply(PsddManager.scala:1125)
    at scala.collection.Iterator$class.foreach(Iterator.scala:893)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
    at operations.PsddManager.readPsdd(PsddManager.scala:1125)
    at main.Main$.main(Main.scala:964)
    at main.Main.main(Main.scala)