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

Add --samples to hirm binary #187

Merged
merged 8 commits into from
Sep 6, 2024
Merged

Conversation

ThomasColthurst
Copy link

This PR is not ready to check in yet, because actually using --samples is way too slow in practice. For example, the integration test in this PR

/bazel-bin/hirm --seed=1 --iters=5 assets/animals.unary --samples=5

currently hangs for over ten minutes.

However, I believe that is a problem in the current implementation of HIRM::sample_and_incorporate rather than anything this PR adds.

If/when this PR is submitted, it will address #178

@ThomasColthurst
Copy link
Author

Updated with code to
(1) Populate the domain_crps with the already observed entity id's before sampling and
(2) Unincorporate any entities that end up not being used because r_contains_items is true.

Even with these updates, though, the code still doesn't generate samples in a reasonable amount of time. The reason appears to be somesort of mismatch between the entity id's observed by the irm->domains->crp.assignments and the entity id's observed by get_relation(r)->get_data(). For example, when running

./bazel-bin/hirm --seed=1 --iters=5 assets/animals.unary --samples=5

I see only entity id's 0 through 49 being added to domain animal, and that is all irm->domains->crp.assignments sees as well, but get_relation(r)->get_data() contains entity id 50.

@ThomasColthurst
Copy link
Author

Besides the fix to sampling, this commit also updates write_observations to be able to handle entity id's that were created during sampling. I went with the boring "new_[DomainName]_[EntityId]" naming scheme for these; let me know if you have a better idea.

Copy link

@emilyfertig emilyfertig left a comment

Choose a reason for hiding this comment

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

Thanks!

@ThomasColthurst ThomasColthurst merged commit d1f219c into master Sep 6, 2024
2 checks passed
@ThomasColthurst ThomasColthurst deleted the 090424-thomaswc-samples branch September 6, 2024 19:54
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.

2 participants