Non-Bernoulli models are still pretty sparsely tested (I added some minimal coverage in test_misc) but I think this is in a reviewable state.
I'll add support for Categoricals in a follow-up. Plumbing the num_categories parameter through is a little tricky (one idea is to include the number of categories in the distribution name, e.g. categorical12 and then parse it inside of Relation when we need a new distribution instance.)
I changed SampleType to S in DistributionAdapter (which was an alternative approach to generalizing distribution types, which I think we no longer need assuming this PR looks good) due to a name collision with the SampleType that I put in the base class. I moved function/method definitions from normal.hh to normal.cc to avoid multiple-definition errors for logZ.
Non-Bernoulli models are still pretty sparsely tested (I added some minimal coverage in
test_misc
) but I think this is in a reviewable state.I'll add support for Categoricals in a follow-up. Plumbing the
num_categories
parameter through is a little tricky (one idea is to include the number of categories in the distribution name, e.g.categorical12
and then parse it inside ofRelation
when we need a new distribution instance.)I changed
SampleType
toS
inDistributionAdapter
(which was an alternative approach to generalizing distribution types, which I think we no longer need assuming this PR looks good) due to a name collision with theSampleType
that I put in the base class. I moved function/method definitions fromnormal.hh
tonormal.cc
to avoid multiple-definition errors forlogZ
.