probcomp / hierarchical-irm

Probabilistic structure discovery for rich relational systems
Apache License 2.0
1 stars 1 forks source link

Add adapter for turning arbitrary Distributions into string Distributions #19

Closed ThomasColthurst closed 1 month ago

ThomasColthurst commented 1 month ago

My thought was merely that this was a quick-and-dirty solution that could get us quickly using other distributions with minimal changes to the existing code. We could then upgrade to something more complicated (like your std::variant suggestion, or templating the Relation class over the sample type) if we measure and see we are taking a noticeable performance hit from the conversions to/from string.

But concretely, the next two steps I planned after this were to add a get_distribution(distribution_name) function to the distributions/ directory, and to then upgrade hirm.hh to use it. In the process, I would typedef string column_type; and replace all the doubles in hirm.hh that are representing column types to use that instead.