Maximum tree depth parameter now in git

3 views
Skip to first unread message

Marcus Brubaker

unread,
Mar 15, 2012, 5:30:59 PM3/15/12
to stan...@googlegroups.com
I've pushed changes which add a maximum tree depth to NUTS.  It defaults to 10 and can be set from the command line of a generated model program by passing --max_treedepth.  Setting it to -1 will fall back to the previous behavior which does not limit the depth of the tree.

I haven't added a diagnostic to check how often this is hit but I pushed the changes anyway in case someone else has the time and motivation to do that.

Cheers,
Marcus

Bob Carpenter

unread,
Mar 15, 2012, 6:42:42 PM3/15/12
to stan...@googlegroups.com

On 3/15/12 5:30 PM, Marcus Brubaker wrote:
> I've pushed changes which add a maximum tree depth to NUTS. It defaults
> to 10 and can be set from the command line of a generated model program
> by passing --max_treedepth. Setting it to -1 will fall back to the
> previous behavior which does not limit the depth of the tree.

I just checked out the code and it looks great -- thanks
for adding the doc and print.

Using "max_treedepth" makes more sense than specifying
the steps (how I was originally thinking of it) because
it's always a power of 2.

> I haven't added a diagnostic to check how often this is hit but I pushed
> the changes anyway in case someone else has the time and motivation to
> do that.

I'm about to do that.

- Bob

Bob Carpenter

unread,
Mar 15, 2012, 8:13:48 PM3/15/12
to stan...@googlegroups.com
I added code to print out the tree depth used at
each sample along with the other parameters in the
output.

I was surprised to see that the adaptation worked
so well for the Wishart sampler -- it rarely goes
above depth 2 (4 leapfrog steps).

The easiest way to code it turned out to be to
put a pair of virtual methods in the base class
underlying the NUTS and HMC samplers. These
print out the sampler-specific "parameter" names
and then for each sample, their values. It's currently
a no-op for HMC. But this will make it easier if
we want to return other sampler-specific diagnostic
info.

- Bob

On 3/15/12 5:30 PM, Marcus Brubaker wrote:

Reply all
Reply to author
Forward
0 new messages