Skip to content

Commit

Permalink
More seed tweaking, revert some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Feb 28, 2023
1 parent ecea1c9 commit e026895
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <stan/mcmc/hmc/nuts/base_nuts.hpp>
#include <stan/mcmc/hmc/integrators/expl_leapfrog.hpp>
#include <vector>
#include <boost/random/mixmax.hpp>
#include <boost/random/additive_combine.hpp>
#include <gtest/gtest.h>

typedef boost::random::mixmax rng_t;
typedef boost::ecuyer1988 rng_t;

namespace stan {
namespace mcmc {
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <test/test-models/good/mcmc/hmc/common/gauss3D.hpp>
#include <stan/callbacks/stream_logger.hpp>
#include <stan/mcmc/hmc/nuts/softabs_nuts.hpp>
#include <boost/random/mixmax.hpp>
#include <boost/random/additive_combine.hpp>
#include <stan/io/dump.hpp>
#include <fstream>

#include <gtest/gtest.h>

typedef boost::random::mixmax rng_t;
typedef boost::ecuyer1988 rng_t;

TEST(McmcSoftAbsNuts, build_tree_test) {
rng_t base_rng(4839294);
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <test/test-models/good/mcmc/hmc/common/gauss3D.hpp>
#include <stan/callbacks/stream_logger.hpp>
#include <stan/mcmc/hmc/nuts/unit_e_nuts.hpp>
#include <boost/random/mixmax.hpp>
#include <boost/random/additive_combine.hpp>
#include <stan/io/dump.hpp>
#include <fstream>

#include <gtest/gtest.h>

typedef boost::random::mixmax rng_t;
typedef boost::ecuyer1988 rng_t;

TEST(McmcUnitENuts, build_tree_test) {
rng_t base_rng(4839294);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

#include <test/test-models/good/mcmc/hmc/common/gauss.hpp>

#include <boost/random/mixmax.hpp>
#include <boost/random/additive_combine.hpp>

#include <gtest/gtest.h>

typedef boost::random::mixmax rng_t;
typedef boost::ecuyer1988 rng_t;

TEST(McmcStaticUniform, unit_e_transition) {
rng_t base_rng(4839294);
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#include <stan/callbacks/stream_logger.hpp>
#include <stan/mcmc/hmc/xhmc/base_xhmc.hpp>
#include <stan/mcmc/hmc/integrators/expl_leapfrog.hpp>
#include <boost/random/mixmax.hpp>
#include <boost/random/additive_combine.hpp>
#include <gtest/gtest.h>

typedef boost::random::mixmax rng_t;
typedef boost::ecuyer1988 rng_t;

namespace stan {
namespace mcmc {
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <stan/callbacks/stream_logger.hpp>
#include <stan/mcmc/hmc/xhmc/softabs_xhmc.hpp>
#include <boost/random/mixmax.hpp>
#include <boost/random/additive_combine.hpp>
#include <test/test-models/good/mcmc/hmc/common/gauss3D.hpp>
#include <stan/io/dump.hpp>
#include <fstream>

#include <gtest/gtest.h>

typedef boost::random::mixmax rng_t;
typedef boost::ecuyer1988 rng_t;

TEST(McmcUnitEXHMC, build_tree) {
rng_t base_rng(4839294);
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <stan/callbacks/stream_logger.hpp>
#include <stan/mcmc/hmc/xhmc/unit_e_xhmc.hpp>
#include <boost/random/mixmax.hpp>
#include <boost/random/additive_combine.hpp>
#include <test/test-models/good/mcmc/hmc/common/gauss3D.hpp>
#include <stan/io/dump.hpp>
#include <fstream>

#include <gtest/gtest.h>

typedef boost::random::mixmax rng_t;
typedef boost::random::ecuyer1988 rng_t;

TEST(McmcUnitEXHMC, build_tree) {
rng_t base_rng(4839294);
Expand Down
7 changes: 1 addition & 6 deletions src/test/unit/variational/eta_adapt_small_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class eta_adapt_small_test : public ::testing::Test {

model_ = new stan_model(data_var_context, 0, &model_stream_);
cont_params_ = Eigen::VectorXd::Zero(model_->num_params_r());
base_rng_.seed(727802408);
base_rng_.seed(1234568u);
model_stream_.str("");
log_stream_.str("");

Expand Down Expand Up @@ -62,11 +62,6 @@ TEST_F(eta_adapt_small_test, eta_should_be_small) {
stan::variational::normal_fullrank fullrank_init
= stan::variational::normal_fullrank(cont_params_);

#if BOOST_VERSION >= 106400
EXPECT_EQ(0.1, advi_meanfield_->adapt_eta(meanfield_init, 1000, logger));
EXPECT_EQ(0.1, advi_fullrank_->adapt_eta(fullrank_init, 1000, logger));
#else
EXPECT_EQ(0.1, advi_meanfield_->adapt_eta(meanfield_init, 50, logger));
EXPECT_EQ(0.1, advi_fullrank_->adapt_eta(fullrank_init, 50, logger));
#endif
}

0 comments on commit e026895

Please sign in to comment.