-
-
Notifications
You must be signed in to change notification settings - Fork 379
Closed
Labels
Description
Summary:
The console output of the laplace_sample method contains hundreds of blank lines.
Description:
This arises from two things:
- messages sent to the logger include newlines which aren't needed as the callbacks writer add these, e.g.:
logger.info("Calculating Hessian\n"); - the logger is called on empty stringstreams
To fix the former, remove newlines.
To fix the latter, check the stringstream before calling the logger.
model.write_array(rng, unc_draw, draw_vec, include_tp, include_gq, &write_array_msgs);
if (refresh > 0) {
if (write_array_msgs.peek() != std::char_traits<char>::eof())
logger.info(write_array_msgs);
Reproducible Steps:
Use CmdStan branch https://github.com/stan-dev/cmdstan/tree/feature/1123-laplace-approx to invoke the laplace_sample method, model and input files are in the src/test/test-models/ directory.
> src/test/test-models/multi_normal_model laplace mode=src/test/test-models/multi_normal_mode.csv
Current Output:
the beginning of the console ouput from call to laplace_sample - refresh is default 100, so lots of whitespace between iteration messages.
Calculating Hessian
Calculating inverse of Cholesky factor
Generating draws
iteration:
0
Expected Output:
Calculating Hessian
Calculating inverse of Cholesky factor
Generating draws
iteration: 0
iteration: 100
iteration: 200
iteration: 300
iteration: 400
iteration: 500
iteration: 600
iteration: 700
iteration: 800
iteration: 900
Additional Information:
Provide any additional information here.
Current Version:
v2.30.0