Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-memory Modes #29

Open
hayesall opened this issue Jun 5, 2022 · 0 comments
Open

In-memory Modes #29

hayesall opened this issue Jun 5, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@hayesall
Copy link
Member

hayesall commented Jun 5, 2022

Good first part to #28 : Extract a small API to set the modes directly in Java instead of loading them from a file every time.


Running something like this:

package edu.wisc.cs.will;

import edu.wisc.cs.will.Boosting.Common.RunBoostedModels;

public class RunToyCancer
{
    public void runToyCancerLearnInfer() {
        String[] trainArgs = {"-l", "-train", "/toy_cancer/train/", "-target", "cancer", "-trees", "10"};
        RunBoostedModels.main(trainArgs);

        String[] testArgs = {"-i", "-model", "/toy_cancer/train/models/", "-test", "/toy_cancer/test/", "-target", "cancer"};
        RunBoostedModels.main(testArgs);
    }
}

Passes a list of _pos, _neg, _facts, and _bk files between objects, eventually ending up as buffered readers in ILPOuterLoop and LearnOneClause.

Start with something like this:

public void runTC()
{
  String newline = System.getProperty("line.separator");
  String localModes = String.join(
          newline,
          "usePrologVariables: true.",
          "mode: friends(+person,-person).",
          "mode: friends(-person,+person).",
          "mode: smokes(+person).",
          "mode: cancer(+person)."
  );

  // Fill
  // String[] trainArgs = {""};

  RunBoostedModels.newMain(trainArgs, localModes);
}
@hayesall hayesall added the enhancement New feature or request label Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant