Skip to content

Commit

Permalink
Activate model!
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesYang007 committed Jul 12, 2020
1 parent 1178f4f commit bee36c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/mcmc/sampler_tools_unittest.cpp
Expand Up @@ -39,6 +39,7 @@ struct sampler_tools_fixture : ::testing::Test
TEST_F(sampler_tools_fixture, init_param_disc)
{
auto model = (dw |= bernoulli(0.5));
activate(model);
init_params(model, gen, disc_values);
for (size_t i = 0; i < size; ++i) {
EXPECT_LE(0, disc_values[i]);
Expand All @@ -49,6 +50,7 @@ TEST_F(sampler_tools_fixture, init_param_disc)
TEST_F(sampler_tools_fixture, init_param_cont_unbounded)
{
auto model = (cw |= normal(0., 1.));
activate(model);
init_params(model, gen, cont_values);
for (size_t i = 0; i < size; ++i) {
EXPECT_LT(math::neg_inf<cont_value_t>, cont_values[i]);
Expand All @@ -61,6 +63,7 @@ TEST_F(sampler_tools_fixture, init_param_cont_bounded)
cont_value_t min = 0.;
cont_value_t max = 0.000001;
auto model = (cw |= uniform(min, max));
activate(model);
init_params(model, gen, cont_values);
for (size_t i = 0; i < size; ++i) {
EXPECT_LE(min, cont_values[i]);
Expand All @@ -71,6 +74,7 @@ TEST_F(sampler_tools_fixture, init_param_cont_bounded)
TEST_F(sampler_tools_fixture, store_sample)
{
auto model = (cw |= normal(0., 1.));
activate(model);
store_sample(model, cont_values, 0); // store first sample
for (size_t i = 0; i < size; ++i) {
EXPECT_DOUBLE_EQ(cont_one_samples[i], cont_values[i]);
Expand Down

0 comments on commit bee36c5

Please sign in to comment.