Skip to content

Commit

Permalink
Fixed order of updated inverse metric with stepsize (Issue #2881)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbales2 committed Nov 2, 2020
1 parent a67e9e5 commit a8e7500
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/stan/mcmc/hmc/nuts/adapt_dense_e_nuts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class adapt_dense_e_nuts : public dense_e_nuts<Model, BaseRNG>,
= this->covar_adaptation_.learn_covariance(inv_metric, this->z_.q);

if (update) {
this->init_stepsize(logger);

this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);

this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down
4 changes: 2 additions & 2 deletions src/stan/mcmc/hmc/nuts/adapt_diag_e_nuts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class adapt_diag_e_nuts : public diag_e_nuts<Model, BaseRNG>,
= this->var_adaptation_.learn_variance(inv_metric, this->z_.q);

if (update) {
this->init_stepsize(logger);

this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);

this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down
4 changes: 2 additions & 2 deletions src/stan/mcmc/hmc/nuts_classic/adapt_dense_e_nuts_classic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class adapt_dense_e_nuts_classic : public dense_e_nuts_classic<Model, BaseRNG>,
= this->covar_adaptation_.learn_covariance(inv_metric, this->z_.q);

if (update) {
this->init_stepsize(logger);

this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);

this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down
4 changes: 2 additions & 2 deletions src/stan/mcmc/hmc/nuts_classic/adapt_diag_e_nuts_classic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class adapt_diag_e_nuts_classic : public diag_e_nuts_classic<Model, BaseRNG>,
= this->var_adaptation_.learn_variance(inv_metric, this->z_.q);

if (update) {
this->init_stepsize(logger);

this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);

this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down
4 changes: 2 additions & 2 deletions src/stan/mcmc/hmc/static/adapt_dense_e_static_hmc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class adapt_dense_e_static_hmc : public dense_e_static_hmc<Model, BaseRNG>,
= this->covar_adaptation_.learn_covariance(inv_metric, this->z_.q);

if (update) {
this->init_stepsize(logger);
this->update_L_();
this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);
this->update_L_();
this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down
4 changes: 2 additions & 2 deletions src/stan/mcmc/hmc/static/adapt_diag_e_static_hmc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class adapt_diag_e_static_hmc : public diag_e_static_hmc<Model, BaseRNG>,
= this->var_adaptation_.learn_variance(inv_metric, this->z_.q);

if (update) {
this->init_stepsize(logger);
this->update_L_();
this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);
this->update_L_();
this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class adapt_dense_e_static_uniform
= this->covar_adaptation_.learn_covariance(inv_metric, this->z_.q);

if (update) {
this->init_stepsize(logger);

this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);

this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class adapt_diag_e_static_uniform
bool update
= this->var_adaptation_.learn_variance(inv_metric, this->z_.q);
if (update) {
this->init_stepsize(logger);

this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);

this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down
4 changes: 2 additions & 2 deletions src/stan/mcmc/hmc/xhmc/adapt_dense_e_xhmc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class adapt_dense_e_xhmc : public dense_e_xhmc<Model, BaseRNG>,
= this->covar_adaptation_.learn_covariance(inv_metric, this->z_.q);

if (update) {
this->init_stepsize(logger);

this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);

this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down
4 changes: 2 additions & 2 deletions src/stan/mcmc/hmc/xhmc/adapt_diag_e_xhmc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class adapt_diag_e_xhmc : public diag_e_xhmc<Model, BaseRNG>,
= this->var_adaptation_.learn_variance(inv_metric, this->z_.q);

if (update) {
this->init_stepsize(logger);

this->z_.set_inv_metric(inv_metric);

this->init_stepsize(logger);

this->stepsize_adaptation_.set_mu(log(10 * this->nom_epsilon_));
this->stepsize_adaptation_.restart();
}
Expand Down

0 comments on commit a8e7500

Please sign in to comment.