Stan print progress

46 views
Skip to first unread message

Jiqiang Guo

unread,
Apr 19, 2013, 9:53:52 PM4/19/13
to stan...@googlegroups.com
In the new code, we print progress of warmup and sampling separately.  Is this our intended behavior?  This is an example:

$ ./dogs --iter=10 --data=dogs.data.R
STAN SAMPLING COMMAND
......
delta = 0.5
gamma = 0.05
Iteration: 1 / 5 [ 20%]  (Warmup)
Iteration: 2 / 5 [ 40%]  (Warmup)
Iteration: 3 / 5 [ 60%]  (Warmup)
Iteration: 4 / 5 [ 80%]  (Warmup)
Iteration: 5 / 5 [100%]  (Warmup)
Iteration: 1 / 5 [ 20%]  (Sampling)
Iteration: 2 / 5 [ 40%]  (Sampling)
Iteration: 3 / 5 [ 60%]  (Sampling)
Iteration: 4 / 5 [ 80%]  (Sampling)
Iteration: 5 / 5 [100%]  (Sampling)

Elapsed Time: 0.003949 seconds (Warm Up)
              0.010438 seconds (Sampling)
              0.014387 seconds (Total)

--
Jiqiang 

Andrew Gelman

unread,
Apr 19, 2013, 10:03:57 PM4/19/13
to stan...@googlegroups.com
I think we should over-write, not have it give a new line for each update.


--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Andrew Gelman
Professor, Department of Statistics
Professor, Department of Political Science
Director, Applied Statistics Center
Columbia University, New York
gel...@stat.columbia.edu
http://www.stat.columbia.edu/~gelman

** I never read my email before 4pm. **

Statistics Department office:
  Social Work Bldg (Amsterdam Ave at 122 St), Room 1016
  phone 212-851-2142, fax 212-851-2164
Political Science Dept office:
  International Affairs Bldg (Amsterdam Ave at 118 St), Room 731
  phone 212-854-7075, fax 212-222-0598
Playroom:
  International Affairs Bldg (Amsterdam Ave at 118 St), Room 731

Mailing address:  Andrew Gelman, Department of Statistics, Columbia University, New York, N.Y. 10027

Michael Betancourt

unread,
Apr 19, 2013, 10:06:50 PM4/19/13
to stan...@googlegroups.com
That was indeed my intention as it helps to isolate the performance of warm-up verses sampling.
--

Michael Betancourt

unread,
Apr 19, 2013, 10:09:12 PM4/19/13
to stan...@googlegroups.com
That should be doable from the command line - I'll add it to the list.

Michael Betancourt

unread,
Apr 20, 2013, 7:13:05 AM4/20/13
to stan...@googlegroups.com
Disregard my previous email -- I forgot how unportable carriage returns are. We're stuck with this unless we want to add an ncurses dependency.

On Apr 20, 2013, at 3:03 AM, Andrew Gelman <andrew....@gmail.com> wrote:

Bob Carpenter

unread,
Apr 20, 2013, 4:23:38 PM4/20/13
to stan...@googlegroups.com
Is there an equivalent of std::endl for carriage return?

It used to overwrite, but then I went back to just writing
out one at a time due to portability issues.

Right now, we have std::endl in command-line code,
which generates platform-specific output. But we
have "\n" hard-coded into the code generator and
into our output file generation to standardize on
unix-style newlines.


- Bob

Michael Betancourt

unread,
Apr 20, 2013, 5:32:20 PM4/20/13
to stan...@googlegroups.com
Nope - iostreams are literally streams and don't implement the functionality required for carriage return (which would require more integration into the terminal environment). \r works on Windows and some Linux boxes but it's not guaranteed. It looks like ncurses is the only library that enables carriage-return functionality on most systems, but it also does so with significantly more overhead than iostreams.
Reply all
Reply to author
Forward
0 new messages