starling-lab / BoostSRL

BoostSRL: "Boosting for Statistical Relational Learning." A gradient-boosting based approach for learning different types of SRL models.
https://starling.utdallas.edu
GNU General Public License v3.0
32 stars 21 forks source link

Grounded Relational Random Walks #28

Open askrix opened 5 years ago

askrix commented 5 years ago

Dear starling-lab team,

I tried to use the new introduced features for BoostSRL v1.1: Lifted and Grounded Relational Random Walks. The routine of the first technique works flawless and was able to run the example described on the wiki page. Whereas, the example of Grounded RRW caused the one path finding error. (Please see the file initial_error.txt for details). I overlooked that the problem lies in the line 99 of RunGroundRelationalRandomWalks.java: disc_flag=flagObj.checkflagvalues(cmd.getTestDirVal()); So, I corrected in my opinion suspicious lines 114 and 137, because I'm using Linux and not Windows: File f = new File(cmd.getTrainDirVal()+"\\"+cmd.trainDir+"_facts_disc.txt"); File f = new File(cmd.getTestDirVal().replace("/","\\"+cmd.testDir+"_facts_disc.txt"));

Afterwards, I tried to compile the library using maven (i.e. using the command mvn package). The first try has failed. (Please see the file first_compilation_attempt.txt for further details). So, I had to reorganize the project's source folder structure from /src/... to /src/main/java/... The second attempt to compile was either not successful and I got two errors:

  1. [ERROR] /home/user/Documents/Tools/BoostSRL/src/main/java/edu/wisc/cs/will/Boosting/Utils/ConvertProximityXMLToFacts.java:[23,21] package org.omg.CORBA does not exist
  2. [ERROR] /home/user/Documents/Tools/BoostSRL/src/main/java/edu/wisc/cs/will/Utils/disc.java:[7,36] package com.sun.xml.internal.ws.util does not exist

I got rid of the first error by switching from OpenJDK 11 to OpenJDK 8 using the command sudo update-alternatives --config java. The second error was caused due to the usage of OpenJDK instead of Oracle's JDK. In order to deal with it, I commented out the line 7 in the class disc.java. I have no idea about how crucial it is, but afterword I was able to compile the library without any errors.

Following the initial error of the line 99 of RunGroundRelationalRandomWalks.java I tried to debug the class check_disc.java.zip. Nonetheless, the issue is not resolved error_after_debugging.txt.

Please let me know, if I should provide more details on generated outputs.

Many thanks in advance!

askrix commented 5 years ago

I resolve the first error:

java.io.FileNotFoundException: test\test_bk.txt (file or directory not found) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at java.io.FileInputStream.<init>(FileInputStream.java:93) at edu.wisc.cs.will.Utils.check_disc.checkflagvalues(check_disc.java:20) at edu.wisc.cs.will.GroundRelationalRandomWalks.RunGroundRelationalRandomWalks.main(RunGroundRelationalRandomWalks.java:99)

In addition to the changes I've posted in my last post I used FileInputStream fstream = new FileInputStream(bkpath.trim()); in check_disc.java. The cause of the error is the command line of Linux which passes invisible characters. I stumbled accidental upon the following thread.

Nontheless, the second error appears every single time in the line runClass.setCmdArgs(cmd); of RundGroundRelationalRandomWalks.java:

% Did not learn a model for 'advisedBy' this run. java.io.FileNotFoundException: train/models/bRDNs/advisedBy.model (file or directory not found) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at java.io.FileInputStream.<init>(FileInputStream.java:93) at edu.wisc.cs.will.Utils.condor.CondorFileInputStream.<init>(CondorFileInputStream.java:49) at edu.wisc.cs.will.Utils.condor.CondorFileReader.<init>(CondorFileReader.java:32) at edu.wisc.cs.will.Boosting.RDN.ConditionalModelPerPredicate.loadModel(ConditionalModelPerPredicate.java:315) at edu.wisc.cs.will.Boosting.MLN.RunBoostedMLN.loadModel(RunBoostedMLN.java:250) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.beforeInfer(RunBoostedModels.java:177) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.inferModel(RunBoostedModels.java:165) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.runJob(RunBoostedModels.java:64) at edu.wisc.cs.will.GroundRelationalRandomWalks.RunGroundRelationalRandomWalks.main(RunGroundRelationalRandomWalks.java:176) Exception in thread "main" edu.wisc.cs.will.Utils.WILLthrownError: Problem encountered reading model: train/models/bRDNs/advisedBy.model at edu.wisc.cs.will.Utils.Utils.error(Utils.java:484) at edu.wisc.cs.will.Boosting.RDN.ConditionalModelPerPredicate.loadModel(ConditionalModelPerPredicate.java:386) at edu.wisc.cs.will.Boosting.MLN.RunBoostedMLN.loadModel(RunBoostedMLN.java:250) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.beforeInfer(RunBoostedModels.java:177) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.inferModel(RunBoostedModels.java:165) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.runJob(RunBoostedModels.java:64) at edu.wisc.cs.will.GroundRelationalRandomWalks.RunGroundRelationalRandomWalks.main(RunGroundRelationalRandomWalks.java:176)

From here on I have no clue how to proceed in order to debug it... I have no deep insight into the library and appreciate any help.

askrix commented 5 years ago

Dear starling-lab team,

I'd like to share my further findings. The error I wrote about in my latter post had the following different cause which has nothing to do with "buggy" implementation of routines for both Lifted and Grounded Relational Random Walks . In my further explanations below I'll use the outputs generated for the UW-CSE data set.

In order to able to run the routine for Grounded RRWs without errors one has first to run the one for Lifted first. By doing so I got rid of the error train/models/bRDNs/advisedBy.model and obtained the file "OutputRW.txt". Please see the both attached files "facts.txt" and "RWRPredicates.txt" for further details.

Nonetheless, the "OutputRW.txt" was empty afterwards. I was confused because I expected the library to use "facts.txt" and "RWRPredicates.txt" for producing of Grounded RWRs. In order to correct it, one has to rewrite each line from "facts.txt" according to the pattern: randomwalkconstraint: predicate_name=option_1,option_2,...,option_k. and put those into "uwcse_bk.txt". Since it's not explained on the wiki page, could you please explain me what did I wrong or it suppose to be so. If the latter is the case, please expand the wiki page accordingly.

Thank you very much in advance! RWRPredicates.txt facts.txt OutputRW.txt

P.S.: Here is the java class check_disk.javawith minor corrections. check_disc.java.zip