Skip to content

Commit

Permalink
Merge branch 'master' into model-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Jan 26, 2024
2 parents c23f522 + 3c7a1a9 commit 0ac09f9
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ubuntu-r-4.0-1-${{ hashFiles('.github/depends.Rds') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmdstan-tarball-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ analysis.
You can install the latest beta release of the **cmdstanr** R package with

```r
# we recommend running this is a fresh R session or restarting your current session
# we recommend running this in a fresh R session or restarting your current session
install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
```
This does not install the vignettes, which take a long time to build, but they are always available
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-model-laplace.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ test_that("laplace() runs when all arguments specified validly", {
expect_equal(fit1$mode()$metadata()$jacobian, as.integer(ok_arg_values$jacobian))
expect_equal(fit1$mode()$metadata()$init_alpha, ok_arg_values$opt_args$init_alpha)

# https://github.com/stan-dev/cmdstan/issues/1242
#expect_equal(fit1$mode()$metadata()$tol_obj, ok_arg_values$opt_args$tol_obj, tolerance = 0)
expect_equal(fit1$mode()$metadata()$tol_obj, ok_arg_values$opt_args$tol_obj, tolerance = 0)

# leaving all at default (except 'data')
expect_laplace_output(fit2 <- mod$laplace(data = data_list, seed = 123))
Expand Down
14 changes: 6 additions & 8 deletions tests/testthat/test-model-optimize.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ test_that("optimize() works with (L-)BFGS tolerances specified", {
# using values that aren't the defaults
init_alpha = 0.002,
tol_obj = 2e-11,
tol_rel_obj = 10001,
tol_rel_obj = 1000,
tol_grad = 5e-07,
tol_rel_grad = 10000001,
tol_rel_grad = 1000000,
tol_param = 5e-07,
history_size = 6,
seed = 123
Expand All @@ -128,12 +128,10 @@ test_that("optimize() works with (L-)BFGS tolerances specified", {
metadata <- fit$metadata()
expect_equal(metadata$init_alpha, 0.002)
expect_equal(metadata$tol_obj, 2e-11)
expect_equal(metadata$tol_rel_obj, 10001)
# https://github.com/stan-dev/cmdstan/issues/1242
# expect_equal(metadata$tol_grad, 5e-07)
expect_equal(metadata$tol_rel_grad, 10000001)
# https://github.com/stan-dev/cmdstan/issues/1242
# expect_equal(metadata$tol_param, 5e-07)
expect_equal(metadata$tol_rel_obj, 1000)
expect_equal(metadata$tol_grad, 5e-07)
expect_equal(metadata$tol_rel_grad, 1000000)
expect_equal(metadata$tol_param, 5e-07)
expect_equal(metadata$history_size, 6)
})

Expand Down
2 changes: 1 addition & 1 deletion vignettes/articles-online-only/opencl.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ mdata <- list(k = k, n = n, y = y, X = X)
In this model, most of the computation will be handled by the
`bernoulli_logit_glm_lpmf` function. Because this is a supported GPU function,
it should be possible to accelerate it with OpenCL. Check
[here](http://mc-stan.org/math/d0/d8f/opencl_support.html) for a list of functions
[here](https://mc-stan.org/math/md_doxygen_2parallelism__support_2opencl__support.html) for a list of functions
with OpenCL support.

To build the model with OpenCL support, add
Expand Down

0 comments on commit 0ac09f9

Please sign in to comment.