Skip to content

Commit

Permalink
deploy: 6867b6d
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Dec 26, 2023
1 parent 529baaf commit f8a985a
Show file tree
Hide file tree
Showing 26 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion R/laplace.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ stan_laplace <- function(fn, par_inits, additional_args = list(),
write_inits(mode_vals, mode_file)
method_args <- list(
mode = mode_file,
jacobian = jacobian,
jacobian = format_bool(jacobian),
draws = draws
)

Expand Down
5 changes: 2 additions & 3 deletions R/optimize.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ stan_optimize <- function(fn, par_inits, additional_args = list(), algorithm = "
history_size = NULL) {
inputs <- prepare_inputs(fn, par_inits, additional_args, grad_fun, lower, upper,
output_dir, output_basename)

method_args <- list(
algorithm = algorithm,
algorithm_args = list(
Expand All @@ -88,9 +87,9 @@ stan_optimize <- function(fn, par_inits, additional_args = list(), algorithm = "
tol_param = tol_param,
history_size = history_size
),
jacobian = jacobian,
jacobian = format_bool(jacobian),
iter = iter,
save_iterations = save_iterations
save_iterations = format_bool(save_iterations)
)

output <- list(
Expand Down
2 changes: 1 addition & 1 deletion R/pathfinder.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ stan_pathfinder <- function(fn, par_inits, additional_args = list(), grad_fun =
history_size = history_size,
num_psis_draws = num_psis_draws,
num_paths = num_paths,
save_single_paths = save_single_paths,
save_single_paths = format_bool(save_single_paths),
max_lbfgs_iters = max_lbfgs_iters,
num_draws = num_draws,
num_elbo_draws = num_elbo_draws
Expand Down
4 changes: 2 additions & 2 deletions R/sample.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ stan_sample <- function(fn, par_inits, additional_args = list(),
stepsize_jitter = stepsize_jitter
),
adapt = list(
engaged = adapt_engaged,
engaged = format_bool(adapt_engaged),
gamma = adapt_gamma,
delta = adapt_delta,
kappa = adapt_kappa,
Expand All @@ -138,7 +138,7 @@ stan_sample <- function(fn, par_inits, additional_args = list(),
),
num_samples = num_samples,
num_warmup = num_warmup,
save_warmup = save_warmup,
save_warmup = format_bool(save_warmup),
thin = thin,
num_chains = 1
)
Expand Down
7 changes: 7 additions & 0 deletions R/util.R
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,10 @@ call_stan <- function(args_list, ll_fun, grad_fun, quiet) {
}
}
}

format_bool <- function(input) {
if (!is.null(input)) {
input <- as.integer(input)
}
input
}
8 changes: 4 additions & 4 deletions R/variational.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ stan_variational <- function(fn, par_inits, additional_args = list(), algorithm
grad_samples = grad_samples,
elbo_samples = elbo_samples,
eta = eta,
adapt = list( engaged = adapt_engaged, iter = adapt_iter),
tol_rel_obj = NULL,
eval_elbo = NULL,
output_samples = NULL
adapt = list( engaged = format_bool(adapt_engaged), iter = adapt_iter),
tol_rel_obj = tol_rel_obj,
eval_elbo = eval_elbo,
output_samples = output_samples
)

output <- list(
Expand Down
2 changes: 1 addition & 1 deletion bin/macosx/big-sur-x86_64/contrib/4.3/PACKAGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Imports: Rcpp, RcppParallel, posterior, methods, stats, callr
LinkingTo: Rcpp, RcppEigen, BH, RcppParallel, rapidjsonr
Suggests: testthat (>= 3.0.0)
License: MIT + file LICENSE
MD5sum: 74a91242ddaa543226a88d8099bc4a1f
MD5sum: 9880efe9041e649441773a6864543f7b
Binary file modified bin/macosx/big-sur-x86_64/contrib/4.3/PACKAGES.gz
Binary file not shown.
Binary file modified bin/macosx/big-sur-x86_64/contrib/4.3/PACKAGES.rds
Binary file not shown.
Binary file modified bin/macosx/big-sur-x86_64/contrib/4.3/StanEstimators_0.0.0.9000.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/macosx/contrib/4.2/PACKAGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Imports: Rcpp, RcppParallel, posterior, methods, stats, callr
LinkingTo: Rcpp, RcppEigen, BH, RcppParallel, rapidjsonr
Suggests: testthat (>= 3.0.0)
License: MIT + file LICENSE
MD5sum: 1b5a7ddea9f6b87d1e7bf03542c32bb6
MD5sum: 0dc4e29754749246ba29600f8e7145f5
Binary file modified bin/macosx/contrib/4.2/PACKAGES.gz
Binary file not shown.
Binary file modified bin/macosx/contrib/4.2/PACKAGES.rds
Binary file not shown.
Binary file modified bin/macosx/contrib/4.2/StanEstimators_0.0.0.9000.tgz
Binary file not shown.
Binary file modified bin/windows/contrib/4.2/StanEstimators_0.0.0.9000.zip
Binary file not shown.
Binary file modified bin/windows/contrib/4.3/StanEstimators_0.0.0.9000.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Makevars
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PKG_CPPFLAGS = -I"../inst/include" -I"../inst/include/sundials" -D_REENTRANT -DSTAN_THREADS -DRCPP_PARALLEL_USE_TBB=1
PKG_CPPFLAGS = -I"../inst/include" -I"../inst/include/sundials" -D_REENTRANT
PKG_CPPFLAGS += -DSTRICT_R_HEADERS -D_HAS_AUTO_PTR_ETC=0 -DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
PKG_CPPFLAGS += $(shell "${R_HOME}/bin/Rscript" -e "RcppParallel::CxxFlags()" | tail -n 1)
PKG_LIBS = $(shell "${R_HOME}/bin/Rscript" -e "RcppParallel::RcppParallelLibs()" | tail -n 1)
Expand Down
2 changes: 1 addition & 1 deletion src/contrib/PACKAGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Imports: Rcpp, RcppParallel, posterior, methods, stats, callr
LinkingTo: Rcpp, RcppEigen, BH, RcppParallel, rapidjsonr
Suggests: testthat (>= 3.0.0)
License: MIT + file LICENSE
MD5sum: 5a66f495c292f8971f3ac7d38e06d24d
MD5sum: 53affb165a139deab308d67bfbdd40a7
NeedsCompilation: yes
Binary file modified src/contrib/PACKAGES.gz
Binary file not shown.
Binary file modified src/contrib/PACKAGES.rds
Binary file not shown.
Binary file modified src/contrib/StanEstimators_0.0.0.9000.tar.gz
Binary file not shown.

0 comments on commit f8a985a

Please sign in to comment.