Skip to content

Commit

Permalink
Merge pull request #65 from probcomp/061824-thomaswc-testhypers
Browse files Browse the repository at this point in the history
Big factors plus irm_test plus integration test of transition_hyperparameters
  • Loading branch information
ThomasColthurst authored Jun 20, 2024
2 parents 5773f06 + 9626efd commit 8739f5f
Show file tree
Hide file tree
Showing 16 changed files with 970 additions and 728 deletions.
63 changes: 49 additions & 14 deletions cxx/BUILD
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
licenses(["notice"])

cc_library(
name = "headers",
hdrs = glob(
["*.hh"],
allow_empty = False,
),
visibility = [":__subpackages__"],
)

cc_library(
name = "cxxopts",
srcs = ["cxxopts.hpp"],
Expand All @@ -24,12 +15,34 @@ cc_library(
],
)

cc_library(
name = "irm",
hdrs = ["irm.hh"],
srcs = ["irm.cc"],
visibility = [":__subpackages__"],
deps = [
":relation",
":relation_variant",
":util_distribution_variant",
],
)

cc_library(
name = "hirm_lib",
hdrs = ["hirm.hh"],
srcs = ["hirm.cc"],
visibility = [":__subpackages__"],
deps = [
":irm",
],
)

cc_binary(
name = "hirm",
srcs = ["hirm.cc"],
srcs = ["hirm_main.cc"],
deps = [
":cxxopts",
":headers",
":hirm_lib",
":util_distribution_variant",
":util_hash",
":util_io",
Expand All @@ -41,6 +54,7 @@ cc_binary(
cc_library(
name = "relation",
hdrs = ["relation.hh"],
visibility = [":__subpackages__"],
deps = [
":domain",
":util_distribution_variant",
Expand All @@ -50,12 +64,26 @@ cc_library(
],
)

cc_library(
name = "relation_variant",
hdrs = ["relation_variant.hh"],
srcs = ["relation_variant.cc"],
visibility = [":__subpackages__"],
deps = [
":domain",
":relation",
":util_distribution_variant",
"//distributions",
],
)

cc_library(
name = "util_distribution_variant",
srcs = ["util_distribution_variant.cc"],
visibility = [":__subpackages__"],
hdrs = ["util_distribution_variant.hh"],
deps = [
":domain",
"//distributions",
],
)
Expand All @@ -72,11 +100,10 @@ cc_library(
srcs = ["util_io.cc"],
visibility = [":__subpackages__"],
hdrs = [
"hirm.hh",
"util_io.hh",
],
deps = [
":headers",
":hirm_lib",
"//distributions",
],
)
Expand All @@ -86,7 +113,7 @@ cc_library(
srcs = ["util_math.cc"],
hdrs = ["util_math.hh"],
visibility = [":__subpackages__"],
deps = [":headers"],
deps = [],
)

cc_test(
Expand All @@ -98,6 +125,14 @@ cc_test(
],
)

cc_test(
name = "irm_test",
srcs = ["irm_test.cc"],
deps = [
":irm",
"@boost//:test",
],
)
cc_test(
name = "relation_test",
srcs = ["relation_test.cc"],
Expand Down
3 changes: 0 additions & 3 deletions cxx/distributions/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ cc_library(
visibility = ["//:__subpackages__"],
deps = [
":base",
"//:headers",
"//:util_math",
],
)
Expand All @@ -39,7 +38,6 @@ cc_library(
deps = [
":base",
":dirichlet_categorical",
"//:headers",
"//:util_math",
],
)
Expand All @@ -50,7 +48,6 @@ cc_library(
hdrs = ["crp.hh"],
visibility = ["//:__subpackages__"],
deps = [
"//:headers",
"//:util_math",
],
)
Expand Down
3 changes: 2 additions & 1 deletion cxx/distributions/base.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ template <typename T>
class Distribution {
// Abstract base class for probability distributions in HIRM.
// New distribution subclasses need to be added to
// `util_distribution_variant` to be used in the (H)IRM models.
// `relation_variant` and `util_distribution_variant` to be used in the
// (H)IRM models.
public:
typedef T SampleType;
// N is the number of incorporated observations.
Expand Down
Loading

0 comments on commit 8739f5f

Please sign in to comment.