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

Big factors plus irm_test plus integration test of transition_hyperparameters #65

Merged
merged 4 commits into from
Jun 20, 2024

Conversation

ThomasColthurst
Copy link
Collaborator

  1. :hirm is broken up into :irm, :hirm_lib and :hirm.
  2. :headers is removed
  3. :relation_variant is split off from :util_distribution_variant in order to avoid cyclic dependencies.
  4. A pretty small irm_test is added.
  5. test_irm_two_relations.cc is upgraded to use single_step_irm_inference, and because of that must set the distribution hyperparameters from the IRM that is loaded from disk.
  6. Fixed an unused variable warning in relation_test.cc

Copy link
Collaborator

@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.

Looks great, thank you!!

@@ -1,8 +1,9 @@
// Copyright 2024
// See LICENSE.txt

// This file collects classes/functions that depend on the set of distribution
// subclasses and should be updated when a new subclass is added.
// Classes and functions for dealing with Distributions and their values in a
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you update the comment on lines 7-8 of the Distribution base class too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

#include <boost/test/included/unit_test.hpp>
namespace tt = boost::test_tools;

BOOST_AUTO_TEST_CASE(test_irm) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a test for logp? Maybe something like this (assuming I understand correctly):

double logp_score0 = irm.logp_score();
double logp1 = irm.logp(x);
irm.incorporate(x);
double logp_score1 = irm.logp_score();
BOOST_TEST(logp_score1 == logp_score0 + logp1);

(Or fine to do in a follow-up, if you or Srinivas are planning on expanding test coverage/adding HIRM tests later.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, I added that test, which I also expected to pass, but it didn't. Added a TODO for now.

@ThomasColthurst ThomasColthurst merged commit 8739f5f into master Jun 20, 2024
1 of 2 checks passed
@ThomasColthurst ThomasColthurst deleted the 061824-thomaswc-testhypers branch June 20, 2024 14:48
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