From dd455a9d402d15781f8b3c3a818dde9e9ef4eb9f Mon Sep 17 00:00:00 2001 From: Mitzi Morris Date: Wed, 20 Sep 2023 10:44:32 -0400 Subject: [PATCH] Revert "remove unneeded signatures for multi-chain hmc_nuts" This reverts commit af33766c5aeeaf278654bf1934fa011e37d66227. --- .../sample/hmc_nuts_dense_e_adapt.hpp | 163 +++++++++++++++++ .../services/sample/hmc_nuts_diag_e_adapt.hpp | 165 ++++++++++++++++++ .../services/sample/hmc_nuts_unit_e_adapt.hpp | 68 ++++++++ .../hmc_nuts_dense_e_adapt_parallel_test.cpp | 11 +- .../hmc_nuts_diag_e_adapt_parallel_test.cpp | 11 +- .../hmc_nuts_unit_e_adapt_parallel_test.cpp | 4 +- 6 files changed, 406 insertions(+), 16 deletions(-) diff --git a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp index d194698b35d..66d0f954f43 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp @@ -399,6 +399,87 @@ int hmc_nuts_dense_e_adapt( return error_codes::OK; } +/** + * Runs multiple chains of NUTS with adaptation using dense Euclidean metric, + * with a pre-specified dense metric. + * + * @tparam Model Model class + * @tparam InitContextPtr A pointer with underlying type derived from + * `stan::io::var_context` + * @tparam InitInvContextPtr A pointer with underlying type derived from + * `stan::io::var_context` + * @tparam InitWriter A type derived from `stan::callbacks::writer` + * @tparam SamplerWriter A type derived from `stan::callbacks::writer` + * @tparam DiagnosticWriter A type derived from `stan::callbacks::writer` + * @param[in] model Input model (with data already instantiated) + * @param[in] num_chains The number of chains to run in parallel. `init`, + * `init_writer`, `sample_writer`, and `diagnostic_writer` + * must be the same length as this value. + * @param[in] init A std vector of init var contexts for initialization + * of each chain. + * @param[in] init_inv_metric var context exposing an initial dense + * inverse Euclidean metric (must be positive definite) + * @param[in] random_seed random seed for the random number generator + * @param[in] init_chain_id first chain id. The pseudo random number generator + * will advance by for each chain by an integer sequence from `init_chain_id` to + * `init_chain_id+num_chains-1` + * @param[in] init_radius radius to initialize + * @param[in] num_warmup Number of warmup samples + * @param[in] num_samples Number of samples + * @param[in] num_thin Number to thin the samples + * @param[in] save_warmup Indicates whether to save the warmup iterations + * @param[in] refresh Controls the output + * @param[in] stepsize initial stepsize for discrete evolution + * @param[in] stepsize_jitter uniform random jitter of stepsize + * @param[in] max_depth Maximum tree depth + * @param[in] delta adaptation target acceptance statistic + * @param[in] gamma adaptation regularization scale + * @param[in] kappa adaptation relaxation exponent + * @param[in] t0 adaptation iteration offset + * @param[in] init_buffer width of initial fast adaptation interval + * @param[in] term_buffer width of final fast adaptation interval + * @param[in] window initial width of slow adaptation interval + * @param[in,out] interrupt Callback for interrupts + * @param[in,out] logger Logger for messages + * @param[in,out] init_writer std vector of Writer callbacks for unconstrained + * inits of each chain. + * @param[in,out] sample_writer std vector of Writers for draws of each chain. + * @param[in,out] diagnostic_writer std vector of Writers for diagnostic + * information of each chain. + * @return error_codes::OK if successful + */ +template +int hmc_nuts_dense_e_adapt( + Model& model, size_t num_chains, const std::vector& init, + const std::vector& init_inv_metric, + unsigned int random_seed, unsigned int init_chain_id, double init_radius, + int num_warmup, int num_samples, int num_thin, bool save_warmup, + int refresh, double stepsize, double stepsize_jitter, int max_depth, + double delta, double gamma, double kappa, double t0, + unsigned int init_buffer, unsigned int term_buffer, unsigned int window, + callbacks::interrupt& interrupt, callbacks::logger& logger, + std::vector& init_writer, + std::vector& sample_writer, + std::vector& diagnostic_writer) { + std::vector dummy_metric_writer( + num_chains); + if (num_chains == 1) { + return hmc_nuts_dense_e_adapt( + model, *init[0], *init_inv_metric[0], random_seed, init_chain_id, + init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, + stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, + init_buffer, term_buffer, window, interrupt, logger, init_writer[0], + sample_writer[0], diagnostic_writer[0], dummy_metric_writer[0]); + } + return hmc_nuts_dense_e_adapt( + model, num_chains, init, init_inv_metric, random_seed, init_chain_id, + init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, + stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, + init_buffer, term_buffer, window, interrupt, logger, init_writer, + sample_writer, diagnostic_writer, dummy_metric_writer); +} + /** * Runs multiple chains of NUTS with adaptation using dense Euclidean metric, * with identity matrix as initial inv_metric and saves adapted tuning @@ -484,6 +565,88 @@ int hmc_nuts_dense_e_adapt( sample_writer, diagnostic_writer, metric_writer); } +/** + * Runs multiple chains of NUTS with adaptation using dense Euclidean metric, + * with identity matrix as initial inv_metric. + * + * @tparam Model Model class + * @tparam InitContextPtr A pointer with underlying type derived from + * `stan::io::var_context` + * @tparam InitWriter A type derived from `stan::callbacks::writer` + * @tparam SamplerWriter A type derived from `stan::callbacks::writer` + * @tparam DiagnosticWriter A type derived from `stan::callbacks::writer` + * @param[in] model Input model (with data already instantiated) + * @param[in] num_chains The number of chains to run in parallel. `init`, + * `init_writer`, `sample_writer`, and `diagnostic_writer` + * must be the same length as this value. + * @param[in] init A std vector of init var contexts for initialization of each + * chain. + * @param[in] random_seed random seed for the random number generator + * @param[in] init_chain_id first chain id. The pseudo random number generator + * will advance by for each chain by an integer sequence from `init_chain_id` to + * `init_chain_id+num_chains-1` + * @param[in] init_radius radius to initialize + * @param[in] num_warmup Number of warmup samples + * @param[in] num_samples Number of samples + * @param[in] num_thin Number to thin the samples + * @param[in] save_warmup Indicates whether to save the warmup iterations + * @param[in] refresh Controls the output + * @param[in] stepsize initial stepsize for discrete evolution + * @param[in] stepsize_jitter uniform random jitter of stepsize + * @param[in] max_depth Maximum tree depth + * @param[in] delta adaptation target acceptance statistic + * @param[in] gamma adaptation regularization scale + * @param[in] kappa adaptation relaxation exponent + * @param[in] t0 adaptation iteration offset + * @param[in] init_buffer width of initial fast adaptation interval + * @param[in] term_buffer width of final fast adaptation interval + * @param[in] window initial width of slow adaptation interval + * @param[in,out] interrupt Callback for interrupts + * @param[in,out] logger Logger for messages + * @param[in,out] init_writer std vector of Writer callbacks for unconstrained + * inits of each chain. + * @param[in,out] sample_writer std vector of Writers for draws of each chain. + * @param[in,out] diagnostic_writer std vector of Writers for diagnostic + * information of each chain. + * @return error_codes::OK if successful + */ +template +int hmc_nuts_dense_e_adapt( + Model& model, size_t num_chains, const std::vector& init, + unsigned int random_seed, unsigned int init_chain_id, double init_radius, + int num_warmup, int num_samples, int num_thin, bool save_warmup, + int refresh, double stepsize, double stepsize_jitter, int max_depth, + double delta, double gamma, double kappa, double t0, + unsigned int init_buffer, unsigned int term_buffer, unsigned int window, + callbacks::interrupt& interrupt, callbacks::logger& logger, + std::vector& init_writer, + std::vector& sample_writer, + std::vector& diagnostic_writer) { + std::vector> unit_e_metric; + unit_e_metric.reserve(num_chains); + for (size_t i = 0; i < num_chains; ++i) { + unit_e_metric.emplace_back(std::make_unique( + util::create_unit_e_dense_inv_metric(model.num_params_r()))); + } + std::vector dummy_metric_writer( + num_chains); + if (num_chains == 1) { + return hmc_nuts_dense_e_adapt( + model, *init[0], *unit_e_metric[0], random_seed, init_chain_id, + init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, + stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, + init_buffer, term_buffer, window, interrupt, logger, init_writer[0], + sample_writer[0], diagnostic_writer[0], dummy_metric_writer[0]); + } + return hmc_nuts_dense_e_adapt( + model, num_chains, init, unit_e_metric, random_seed, init_chain_id, + init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, + stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, + init_buffer, term_buffer, window, interrupt, logger, init_writer, + sample_writer, diagnostic_writer, dummy_metric_writer); +} + } // namespace sample } // namespace services } // namespace stan diff --git a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp index 3996bc6d5b4..fc1d1f69d5d 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp @@ -399,6 +399,87 @@ int hmc_nuts_diag_e_adapt( return error_codes::OK; } +/** + * Runs multiple chains of HMC with NUTS with adaptation using diagonal + * Euclidean metric with a pre-specified diagonal metric. + * + * @tparam Model Model class + * @tparam InitContextPtr A pointer with underlying type derived from + * `stan::io::var_context` + * @tparam InitContextPtr A pointer with underlying type derived from + * `stan::io::var_context` + * @tparam InitWriter A type derived from `stan::callbacks::writer` + * @tparam SamplerWriter A type derived from `stan::callbacks::writer` + * @tparam DiagnosticWriter A type derived from `stan::callbacks::writer` + * @param[in] model Input model (with data already instantiated) + * @param[in] num_chains The number of chains to run in parallel. `init`, + * `init_writer`, `sample_writer`, and `diagnostic_writer` must be the same + * length as this value. + * @param[in] init A std vector of init var contexts for initialization + * of each chain. + * @param[in] init_inv_metric A std vector of var contexts exposing an initial + * diagonal inverse Euclidean metric for each chain (must be positive definite) + * @param[in] random_seed random seed for the random number generator + * @param[in] init_chain_id first chain id. The pseudo random number generator + * will advance by for each chain by an integer sequence from `init_chain_id` to + * `init_chain_id+num_chains-1` + * @param[in] init_radius radius to initialize + * @param[in] num_warmup Number of warmup samples + * @param[in] num_samples Number of samples + * @param[in] num_thin Number to thin the samples + * @param[in] save_warmup Indicates whether to save the warmup iterations + * @param[in] refresh Controls the output + * @param[in] stepsize initial stepsize for discrete evolution + * @param[in] stepsize_jitter uniform random jitter of stepsize + * @param[in] max_depth Maximum tree depth + * @param[in] delta adaptation target acceptance statistic + * @param[in] gamma adaptation regularization scale + * @param[in] kappa adaptation relaxation exponent + * @param[in] t0 adaptation iteration offset + * @param[in] init_buffer width of initial fast adaptation interval + * @param[in] term_buffer width of final fast adaptation interval + * @param[in] window initial width of slow adaptation interval + * @param[in,out] interrupt Callback for interrupts + * @param[in,out] logger Logger for messages + * @param[in,out] init_writer std vector of Writer callbacks for unconstrained + * inits of each chain. + * @param[in,out] sample_writer std vector of Writers for draws of each chain. + * @param[in,out] diagnostic_writer std vector of Writers for diagnostic + * information of each chain. + * @return error_codes::OK if successful + */ +template +int hmc_nuts_diag_e_adapt( + Model& model, size_t num_chains, const std::vector& init, + const std::vector& init_inv_metric, + unsigned int random_seed, unsigned int init_chain_id, double init_radius, + int num_warmup, int num_samples, int num_thin, bool save_warmup, + int refresh, double stepsize, double stepsize_jitter, int max_depth, + double delta, double gamma, double kappa, double t0, + unsigned int init_buffer, unsigned int term_buffer, unsigned int window, + callbacks::interrupt& interrupt, callbacks::logger& logger, + std::vector& init_writer, + std::vector& sample_writer, + std::vector& diagnostic_writer) { + std::vector dummy_metric_writer( + num_chains); + if (num_chains == 1) { + return hmc_nuts_diag_e_adapt( + model, *init[0], *init_inv_metric[0], random_seed, init_chain_id, + init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, + stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, + init_buffer, term_buffer, window, interrupt, logger, init_writer[0], + sample_writer[0], diagnostic_writer[0], dummy_metric_writer[0]); + } + return hmc_nuts_diag_e_adapt( + model, num_chains, init, init_inv_metric, random_seed, init_chain_id, + init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, + stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, + init_buffer, term_buffer, window, interrupt, logger, init_writer, + sample_writer, diagnostic_writer, dummy_metric_writer); +} + /** * Runs multiple chains of HMC with NUTS with adaptation using diagonal * with identity matrix as initial inv_metric and saves adapted tuning @@ -484,6 +565,90 @@ int hmc_nuts_diag_e_adapt( sample_writer, diagnostic_writer, metric_writer); } +/** + * Runs multiple chains of HMC with NUTS with adaptation using diagonal + * with identity matrix as initial inv_metric. + * + * @tparam Model Model class + * @tparam InitContextPtr A pointer with underlying type derived from + * `stan::io::var_context` + * @tparam InitWriter A type derived from `stan::callbacks::writer` + * @tparam SamplerWriter A type derived from `stan::callbacks::writer` + * @tparam DiagnosticWriter A type derived from `stan::callbacks::writer` + * @param[in] model Input model (with data already instantiated) + * @param[in] num_chains The number of chains to run in parallel. `init`, + * `init_writer`, `sample_writer`, and `diagnostic_writer` must be the same + * length as this value. + * @param[in] init A std vector of init var contexts for initialization of each + * chain. + * @param[in] init_inv_metric var context exposing an initial diagonal + * inverse Euclidean metric (must be positive definite) + * @param[in] random_seed random seed for the random number generator + * @param[in] init_chain_id first chain id. The pseudo random number generator + * will advance by for each chain by an integer sequence from `init_chain_id` to + * `init_chain_id+num_chains-1` + * @param[in] init_radius radius to initialize + * @param[in] num_warmup Number of warmup samples + * @param[in] num_samples Number of samples + * @param[in] num_thin Number to thin the samples + * @param[in] save_warmup Indicates whether to save the warmup iterations + * @param[in] refresh Controls the output + * @param[in] stepsize initial stepsize for discrete evolution + * @param[in] stepsize_jitter uniform random jitter of stepsize + * @param[in] max_depth Maximum tree depth + * @param[in] delta adaptation target acceptance statistic + * @param[in] gamma adaptation regularization scale + * @param[in] kappa adaptation relaxation exponent + * @param[in] t0 adaptation iteration offset + * @param[in] init_buffer width of initial fast adaptation interval + * @param[in] term_buffer width of final fast adaptation interval + * @param[in] window initial width of slow adaptation interval + * @param[in,out] interrupt Callback for interrupts + * @param[in,out] logger Logger for messages + * @param[in,out] init_writer std vector of Writer callbacks for unconstrained + * inits of each chain. + * @param[in,out] sample_writer std vector of Writers for draws of each chain. + * @param[in,out] diagnostic_writer std vector of Writers for diagnostic + * information of each chain. + * @return error_codes::OK if successful + */ +template +int hmc_nuts_diag_e_adapt( + Model& model, size_t num_chains, const std::vector& init, + unsigned int random_seed, unsigned int init_chain_id, double init_radius, + int num_warmup, int num_samples, int num_thin, bool save_warmup, + int refresh, double stepsize, double stepsize_jitter, int max_depth, + double delta, double gamma, double kappa, double t0, + unsigned int init_buffer, unsigned int term_buffer, unsigned int window, + callbacks::interrupt& interrupt, callbacks::logger& logger, + std::vector& init_writer, + std::vector& sample_writer, + std::vector& diagnostic_writer) { + std::vector> unit_e_metric; + unit_e_metric.reserve(num_chains); + for (size_t i = 0; i < num_chains; ++i) { + unit_e_metric.emplace_back(std::make_unique( + util::create_unit_e_diag_inv_metric(model.num_params_r()))); + } + std::vector dummy_metric_writer( + num_chains); + if (num_chains == 1) { + return hmc_nuts_diag_e_adapt( + model, *init[0], *unit_e_metric[0], random_seed, init_chain_id, + init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, + stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, + init_buffer, term_buffer, window, interrupt, logger, init_writer[0], + sample_writer[0], diagnostic_writer[0], dummy_metric_writer[0]); + } + return hmc_nuts_diag_e_adapt( + model, num_chains, init, unit_e_metric, random_seed, init_chain_id, + init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, + stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, + init_buffer, term_buffer, window, interrupt, logger, init_writer, + sample_writer, diagnostic_writer, dummy_metric_writer); +} + } // namespace sample } // namespace services } // namespace stan diff --git a/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp index 08ac9e64762..6af9c742349 100644 --- a/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp @@ -246,6 +246,74 @@ int hmc_nuts_unit_e_adapt( return error_codes::OK; } +/** + * Runs HMC with NUTS with unit Euclidean metric with adaptation for multiple + * chains. + * + * @tparam Model Model class + * @tparam InitContextPtr A pointer with underlying type derived from + * `stan::io::var_context` + * @tparam InitWriter A type derived from `stan::callbacks::writer` + * @tparam SamplerWriter A type derived from `stan::callbacks::writer` + * @tparam DiagnosticWriter A type derived from `stan::callbacks::writer` + * @param[in] model Input model (with data already instantiated) + * @param[in] num_chains The number of chains to run in parallel. `init`, + * `init_inv_metric`, `init_writer`, `sample_writer`, and `diagnostic_writer` + * must be the same length as this value. + * @param[in] init An std vector of init var contexts for initialization of each + * chain. + * @param[in] random_seed random seed for the random number generator + * @param[in] chain chain id to advance the pseudo random number generator + * @param[in] init_radius radius to initialize + * @param[in] num_warmup Number of warmup samples + * @param[in] num_samples Number of samples + * @param[in] num_thin Number to thin the samples + * @param[in] save_warmup Indicates whether to save the warmup iterations + * @param[in] refresh Controls the output + * @param[in] stepsize initial stepsize for discrete evolution + * @param[in] stepsize_jitter uniform random jitter of stepsize + * @param[in] max_depth Maximum tree depth + * @param[in] delta adaptation target acceptance statistic + * @param[in] gamma adaptation regularization scale + * @param[in] kappa adaptation relaxation exponent + * @param[in] t0 adaptation iteration offset + * @param[in,out] interrupt Callback for interrupts + * @param[in,out] logger Logger for messages + * @param[in,out] init_writer std vector of Writer callbacks for unconstrained + * inits of each chain. + * @param[in,out] sample_writer std vector of Writers for draws of each chain. + * @param[in,out] diagnostic_writer std vector of Writers for diagnostic + * information of each chain. + * @return error_codes::OK if successful + */ +template +int hmc_nuts_unit_e_adapt( + Model& model, size_t num_chains, const std::vector& init, + unsigned int random_seed, unsigned int init_chain_id, double init_radius, + int num_warmup, int num_samples, int num_thin, bool save_warmup, + int refresh, double stepsize, double stepsize_jitter, int max_depth, + double delta, double gamma, double kappa, double t0, + callbacks::interrupt& interrupt, callbacks::logger& logger, + std::vector& init_writer, + std::vector& sample_writer, + std::vector& diagnostic_writer) { + std::vector dummy_metric_writer( + num_chains); + if (num_chains == 1) { + return hmc_nuts_unit_e_adapt( + model, *init[0], random_seed, init_chain_id, init_radius, num_warmup, + num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, + max_depth, delta, gamma, kappa, t0, interrupt, logger, init_writer[0], + sample_writer[0], diagnostic_writer[0], dummy_metric_writer[0]); + } + return hmc_nuts_unit_e_adapt( + model, num_chains, init, random_seed, init_chain_id, init_radius, + num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, + stepsize_jitter, max_depth, delta, gamma, kappa, t0, interrupt, logger, + init_writer, sample_writer, diagnostic_writer, dummy_metric_writer); +} + } // namespace sample } // namespace services } // namespace stan diff --git a/src/test/unit/services/sample/hmc_nuts_dense_e_adapt_parallel_test.cpp b/src/test/unit/services/sample/hmc_nuts_dense_e_adapt_parallel_test.cpp index ee7dcca9041..23859ab7554 100644 --- a/src/test/unit/services/sample/hmc_nuts_dense_e_adapt_parallel_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_dense_e_adapt_parallel_test.cpp @@ -1,9 +1,8 @@ #include -#include +#include #include #include #include -#include #include auto&& blah = stan::math::init_threadpool_tbb(); @@ -17,7 +16,6 @@ class ServicesSampleHmcNutsDenseEAdaptPar : public testing::Test { init.push_back(stan::test::unit::instrumented_writer{}); parameter.push_back(stan::test::unit::instrumented_writer{}); diagnostic.push_back(stan::test::unit::instrumented_writer{}); - metric.push_back(stan::callbacks::structured_writer()); context.push_back(std::make_shared()); } } @@ -27,7 +25,6 @@ class ServicesSampleHmcNutsDenseEAdaptPar : public testing::Test { std::vector init; std::vector parameter; std::vector diagnostic; - std::vector metric; std::vector> context; stan_model model; }; @@ -58,7 +55,7 @@ TEST_F(ServicesSampleHmcNutsDenseEAdaptPar, call_count) { model, num_chains, context, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, - interrupt, logger, init, parameter, diagnostic, metric); + interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); @@ -98,7 +95,7 @@ TEST_F(ServicesSampleHmcNutsDenseEAdaptPar, parameter_checks) { model, num_chains, context, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, - interrupt, logger, init, parameter, diagnostic, metric); + interrupt, logger, init, parameter, diagnostic); for (size_t i = 0; i < num_chains; ++i) { std::vector> parameter_names; @@ -162,7 +159,7 @@ TEST_F(ServicesSampleHmcNutsDenseEAdaptPar, output_regression) { model, num_chains, context, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, - interrupt, logger, init, parameter, diagnostic, metric); + interrupt, logger, init, parameter, diagnostic); for (auto&& init_it : init) { std::vector init_values; diff --git a/src/test/unit/services/sample/hmc_nuts_diag_e_adapt_parallel_test.cpp b/src/test/unit/services/sample/hmc_nuts_diag_e_adapt_parallel_test.cpp index f5e33e06509..453b03adcdd 100644 --- a/src/test/unit/services/sample/hmc_nuts_diag_e_adapt_parallel_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_diag_e_adapt_parallel_test.cpp @@ -1,9 +1,8 @@ #include -#include +#include #include #include #include -#include #include auto&& blah = stan::math::init_threadpool_tbb(); @@ -16,7 +15,6 @@ class ServicesSampleHmcNutsDiagEAdaptPar : public testing::Test { init.push_back(stan::test::unit::instrumented_writer{}); parameter.push_back(stan::test::unit::instrumented_writer{}); diagnostic.push_back(stan::test::unit::instrumented_writer{}); - metric.push_back(stan::callbacks::structured_writer()); context.push_back(std::make_shared()); } } @@ -26,7 +24,6 @@ class ServicesSampleHmcNutsDiagEAdaptPar : public testing::Test { std::vector init; std::vector parameter; std::vector diagnostic; - std::vector metric; std::vector> context; stan_model model; }; @@ -57,7 +54,7 @@ TEST_F(ServicesSampleHmcNutsDiagEAdaptPar, call_count) { model, num_chains, context, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, - interrupt, logger, init, parameter, diagnostic, metric); + interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); @@ -97,7 +94,7 @@ TEST_F(ServicesSampleHmcNutsDiagEAdaptPar, parameter_checks) { model, num_chains, context, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, - interrupt, logger, init, parameter, diagnostic, metric); + interrupt, logger, init, parameter, diagnostic); for (size_t i = 0; i < num_chains; ++i) { std::vector> parameter_names; @@ -161,7 +158,7 @@ TEST_F(ServicesSampleHmcNutsDiagEAdaptPar, output_regression) { model, num_chains, context, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, - interrupt, logger, init, parameter, diagnostic, metric); + interrupt, logger, init, parameter, diagnostic); for (auto&& init_it : init) { std::vector init_values; diff --git a/src/test/unit/services/sample/hmc_nuts_unit_e_adapt_parallel_test.cpp b/src/test/unit/services/sample/hmc_nuts_unit_e_adapt_parallel_test.cpp index 10387cf8ac6..5574fa685a6 100644 --- a/src/test/unit/services/sample/hmc_nuts_unit_e_adapt_parallel_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_unit_e_adapt_parallel_test.cpp @@ -76,7 +76,7 @@ TEST_F(ServicesSampleHmcNutsUnitEAdaptPar, call_count) { model, num_chains, context, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, interrupt, logger, init, parameter, - diagnostic, metric); + diagnostic); EXPECT_EQ(0, return_code); @@ -181,7 +181,7 @@ TEST_F(ServicesSampleHmcNutsUnitEAdaptPar, output_regression) { model, num_chains, context, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, interrupt, logger, init, parameter, - diagnostic, metric); + diagnostic); for (auto&& init_it : init) { std::vector init_values;