Skip to content

$optimize() prints output for every iteration when refresh = 0 and algorithm = newton #323

@tcuongd

Description

@tcuongd

Hello! I'm currently running cmdstanr within RStudio.

Describe the bug

When setting refresh = 0 and algorithm = "newton" for the $optimize() method, the output for every iteration gets printed to the console (the format of the message is Iteration []. Log join probability = []. Improved by []., and there is one message per line). This issue does not occur for algorithm = "lbfgs" | "bfgs".

To Reproduce

file <- file.path(cmdstan_path(), "examples/bernoulli/bernoulli.stan")
mod <- cmdstan_model(file)
stan_data <- list(N = 10, y = c(0,1,0,0,0,0,0,0,0,1))
mod$optimize(
  data = stan_data,
  seed = 123,
  algorithm = "newton",
  refresh = 0
)

Expected behavior
No console output.

Operating system

Running under: macOS Catalina 10.15.6
Platform: x86_64-apple-darwin19.4.0 (64-bit)

CmdStanR version number

cmdstanr_0.1.3
.cmdstanr/cmdstan-2.24.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions