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

Stats and logging improvements #19

Merged
merged 2 commits into from
Sep 22, 2021
Merged

Stats and logging improvements #19

merged 2 commits into from
Sep 22, 2021

Conversation

bhntr
Copy link
Contributor

@bhntr bhntr commented Sep 22, 2021

This is a first step toward two simultaneous goals

  1. Make it easy to implement a parallel experiment runner for Popper
  2. Make Popper easier to use programatically from within another
    Python application.

The major changes here are:

  1. Configure the Popper loop to store information about its execution
    in the Stats object. The Stats object can then be serialized or analyzed
    programatically.
  2. Add arguments to the Settings initializer so a Settings object can be
    created without argparse.
  3. Perform all logging using python's logging framework rather than
    print(). This makes it easy for other applications to tune how the
    logging happens, set the log level, etc.

There should be no changes to command line Popper besides a very small
amount of extra memory usage.

For goal 1, future work will include an experiment runner in a
separate repo.

For goal 2, we probably want to add a setup.py file to build a .whl file
from Popper and publish it to PyPi.

1. Make it easy to implement a parallel experiment runner for Popper
2. Make Popper easier to use programatically from within another
Python application.

The major changes here are:
1. Configure the Popper loop to store information about its execution
in the Stats object. The Stats object can then be serialized or analyzed
programatically.
2. Perform all logging using python's logging framework rather than
print(). This makes it easy for other applications to tune how the
logging happens, set the log level, etc.

There should be no changes to command line Popper besides a very small
amount of extra memory usage.

For goal 1, future work will include an experiment runner in a
separate repo.

For goal 2, we probably want to add a setup.py file to build a .whl file
from Popper and publish it to PyPi.
(bk_file, ex_file, bias_string) = load_kbpath(args.kbpath, args.bias_file)

return Settings(
bias_string,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally Settings would take strings for bias, examples and BK. This would make it a lot easier to just generate these programs in an experiment runner without having to create files. But pyswip makes loading a Prolog program from a string overly complicated. So the bias is a string and the BK and examples are files.

Taking these arguments separately (rather than as a folder path ala kbpath) makes it easier to load the files from different locations. In my experience, this can be convenient when running experiments which are minor variations on each other.

@andrewcropper andrewcropper merged commit e094596 into main Sep 22, 2021
@andrewcropper andrewcropper deleted the brad-package-basics branch January 2, 2022 14:58
andrewcropper added a commit that referenced this pull request Mar 2, 2023
twopilenim from Few-Shot Bayesian Imitation Learning with Logical Pro…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants