Cool --- I can be a tiebreaker until others
weigh in.
Jiqiang --- what are you thinking about for
RStan here? I don't know what the conventions are
there.
More inline.
On 7/10/13 5:12 PM, Michael Betancourt wrote:
> Most of the changes you want can be implemented by adding a buffer layer in the hierarchy, although I'm not sure I agree with such a strategy. Comments inline.
>
>> 1) No arguments stops execution, prints help.
>> Current behavior of "./model": runs the model, assumes no data, samples using NUTS2
>>
>> Proposed behavior of "./model" is equivalent to "./model help". Does not sample.
>
> This is new behavior and a break from 1.3.
I think we can set our standards a bit higher than 1.3.
> Personally, I'd prefer to have a default method.
How about having the default method be "help" :-)
Either way's OK with me. I have a slight preference for Daniel's suggested
"help" behavior. It's what git does, and I think git's a good
model to follow.
>> 2) Get rid of "method=<>". Just make it "<>". The set of things that could fit there (currently) would be: {sample, optimize, test}
>> Current command to sample: "./model method=sample" (uses defaults)
>> Current command to optimize: "./model method=optimize" (uses defaults)
>>
>> Proposed command to sample: "./model sample"
>> Proposed command to optimize: "./model optimize"
>
> I can see some of the motivation to removing method, but it does create a singular argument that has to implemented differently from all of the rest.
If it's not too hard to implement, I'd very much like to do it
this way, again following the git model.
>> 3) Only allow one of {sample, optimize, test}. Setting two or more should result in no execution, error message.
>> Current command: "./model method=optimize method=sample" -- runs the sampler
>>
>> Proposed command: "./model optimize sample" -- stops with message like "Only one command {optimize, sample, test} can be called"
>
> Not the desired behavior. I'm looking into it.
If you think of this evaluating left to right, then how about having it
call the optimize command, which shouldn't take "sample" as an argument.
We should probably check for duplicate defs everywhere. 1.3
doesn't do that.
>> 5) Break out "test_gradient" option to "test"/"test gradient"
>> Current command to test gradients: "./model test_gradient"
>> Proposed command to test gradients: "./model test" or "./model test gradient"
>> - "gradient" would be the sub-command to test
>> - I'm thinking about future uses where we may build out other types of tests.
>
> My opinion is to go with a categorical argument, test=test_name
>
> We can make gradient the only test here and leave the rest to be added later.
I like Daniel's suggestion of "./model test". I don't know what to do for
trying to run more than one test at once.
>> 6) Fix help printouts. (I killed a lot of the verbose output, but I didn't do it right.) I think the verbosity should be contextually. From the top level, it should just show the simple help, but when called after some options, it should be verbose.
>>
>> Current command: "./model method=sample test-all"
>> output: "sample" (this is my fault -- it used to print out information about Sampling Algorithm and get into HMC and NUTS. There wasn't much, but there was a description).
>>
>> Proposed command:
>> "./model help" prints as above
>>
>> "./model sample help" prints the options that can be passed to sample directly.
>> "./model sample help-all" prints help novels for each of the algorithms.
>
> Well, it used to do that. I'm not sure what changes you've made.
Agreed. that it should be contextual.
>> 7) For the "./model method=sample algorithm=hmc engine=nuts" replace that with "./model sample nuts"
>> I guess for sampling, I imagine there being a handful of options: {hmc, nuts, metropolis} and we'll add a few more like rmhmc, rmnuts. I think the settings should be flat after that. I'm not sure it helps to have multiple levels of options configurable in this tool. We would always have complete flexibility in C++.
>> The same goes for optimize.
>
> I strongly disagree. Not only do I dislike flattening the sampling options (Riemannian is a property of the metric, not the particular HMC algorithm) but then you have dangling parameters (RMHMC requires fixed point iteration parameters, and if we flatten everything then we have allow other algorithms to have those parameters set or do really awkward parameter validation after the fact.
I agree with Michael's disagreement :-)
I only like flattening the top one, ./model sample.
All of the samplers have a similar flavor in terms of their
input and output. The metric and algorithm (?) make sense
as configurable options. That's what's so cool about the
way Michael set up mcmc!
>> I think the "sample" and "optimize" commands are just defaults. If someone doesn't play with the parameters, it should always work with just "sample."
>
> That is how it currently works, provided we elevate "method" to a special argument that doesn't need the prefix.
Agreed.
>> PS. I just made it crash:
>> make models/basic_distributions/normal
>> ./models/basic_distributions/normal method=optimize
>
> There's a bug somewhere in the translation of the optimization code. I thought I had fixed it.
Is the BFGS code not in? I saw the note on Nesterov.
- Bob