Skip to content

Commit 7f8a51f

Browse files
committed
bugfix
1 parent 7986886 commit 7f8a51f

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/stan/mcmc/hmc/nuts/adapt_dense_e_nuts.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class adapt_dense_e_nuts : public dense_e_nuts<Model, BaseRNG>,
3232
bool update = this->covar_adaptation_.learn_covariance(
3333
this->z_.inv_e_metric_, this->z_.q);
3434

35-
if (update) {
35+
if (update && this->covar_adaptation_.adapt_term_buffer_ > 0) {
3636
this->init_stepsize(logger);
3737

3838
this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));

src/stan/mcmc/hmc/nuts/adapt_diag_e_nuts.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class adapt_diag_e_nuts : public diag_e_nuts<Model, BaseRNG>,
3232
bool update = this->var_adaptation_.learn_variance(this->z_.inv_e_metric_,
3333
this->z_.q);
3434

35-
if (update) {
35+
if (update && this->var_adaptation_.adapt_term_buffer_ > 0) {
3636
this->init_stepsize(logger);
3737

3838
this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));

src/stan/mcmc/windowed_adaptation.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ class windowed_adaptation : public base_adaptation {
109109
}
110110
}
111111

112-
protected:
113-
std::string estimator_name_;
114-
115112
unsigned int num_warmup_;
116113
unsigned int adapt_init_buffer_;
117114
unsigned int adapt_term_buffer_;
118115
unsigned int adapt_base_window_;
119116

117+
protected:
118+
std::string estimator_name_;
119+
120120
unsigned int adapt_window_counter_;
121121
unsigned int adapt_next_window_;
122122
unsigned int adapt_window_size_;

0 commit comments

Comments
 (0)