I just pushed a recursive argument refactoring and I'd like to gauge everyone's opinions. Checkout arg_refactor, build any model (in this branch the nuts_command method just parses arguments and then returns, so the actual model doesn't matter), and run with no arguments to see the options. Then you can play around with specifying (both good and bad) values. Let me know what you think.
-Mike
--
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.
--
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+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> ./models/basic_estimators/normal_censored help
help
Display valid arguments
id
Unique process identifier
Valid values: id > 0
Defaults to 0
data
Input data file
Valid values: All
Defaults to ""
init
Initialization method:"0" initializes to zero,"random" initializes randomly,anything else identifies a file
Valid values: All
Defaults to "random"
test_gradient
Check model gradient against finite differences
random
Random number configuration
Valid subarguments: seed
seed
Random number generator seed
Valid values: seed > 0, if negative seed is generated from time
Defaults to -1
output
File Output Options
Valid subarguments: sample append_sample diagnostic append_diagnostic refresh save_warmup
sample
Output file for sample information
Valid values: All
Defaults to samples.csv
append_sample
Append sample output to existing file?
Valid values: [0, 1]
Defaults to 0
diagnostic
Output file for diagnostic information
Valid values: All
Defaults to ""
append_diagnostic
Append diagnostic output to existing file?
Valid values: [0, 1]
Defaults to 0
refresh
Number of interations between screen updates
Valid values: 0 < refresh
Defaults to 100
save_warmup
Stream warmup samples to output?
Valid values: [0, 1]
Defaults to 0
method
Analysis method
Valid values: sample optimize
Defaults to sample
sample
Bayesian inference with Markov Chain Monte Carlo
Valid subarguments: iter warmup save_warmup thin adapt algorithm
iter
Total number of iterations
Valid values: 0 < iter
Defaults to 2000
warmup
Number of sampling iterations reserved for warmup
Valid values: 0 < warmup
Defaults to 1000
save_warmup
Stream warmup samples to output?
Valid values: [0, 1]
Defaults to 0
thin
Period between saved samples
Valid values: 0 < thin
Defaults to 1
adapt
Warmup Adaptation
Valid subarguments: engaged gamma delta kappa t0
engaged
Adaptation engaged?
Valid values: [0, 1]
Defaults to 0
gamma
Adaptation regularization scale
Valid values: 0 < gamma
Defaults to 0.05
delta
Adaptation target acceptance statistic
Valid values: 0 < delta < 1
Defaults to 0.65
kappa
Adaptation relaxation exponent
Valid values: 0 < kappa
Defaults to 0.75
t0
Adaptation iteration offset
Valid values: 0 < t0
Defaults to 10
algorithm
Sampling algorithm
Valid values: hmc metro
Defaults to hmc
hmc
Hamiltonian Monte Carlo
Valid subarguments: engine metric stepsize stepsize_jitter
engine
Engine for Hamiltonian Monte Carlo
Valid values: static nuts
Defaults to static
static
Static integration time
Valid subarguments: int_time stepsize
int_time
Total integration time for Hamiltonian evolution
Valid values: 0 < int_time
Defaults to 2 * pi
stepsize
Step size for discrete evolution
Valid values: 0 < stepsize
Defaults to 1
nuts
The No-U-Turn Sampler
Valid subarguments: max_depth
max_depth
Maximum tree depth
Valid values: 0 < max_depth
Defaults to 10
metric
Geometry of base manifold
Valid values: unit_e diag_e dense_e
Defaults to unit_e
unit_e
Euclidean manifold with unit metric
diag_e
Euclidean manifold with diag metric
dense_e
Euclidean manifold with dense metric
stepsize
Step size for discrete evolution
Valid values: 0 < stepsize
Defaults to 1
stepsize_jitter
Uniformly random jitter of the stepsize, in percent
Valid values: 0 < stepsize_jitter < 1
Defaults to 0
metro
Random Walk Metropolis Monte Carlo
Valid subarguments:
optimize
Point estimation
Valid subarguments: algorithm iter save_iterations
algorithm
Optimization algorithm
Valid values: nesterov bfgs newton
Defaults to nesterov
nesterov
Nesterov's accelerated gradient method
Valid subarguments: stepsize
stepsize
Step size for discrete evolution
Valid values: 0 < stepsize
Defaults to 1
bfgs
BFGS with linesearch
Valid subarguments:
newton
Newton's method
Valid subarguments:
iter
Total number of iterations
Valid values: 0 < iter
Defaults to 2000
save_iterations
Stream optimization progress to output?
Valid values: [0, 1]
Defaults to 0
> ./models/basic_estimators/normal_censored help
usage: model [--version]
[id=<number>]
[init={0|random|<path>}]
[data=<path>]
<command> [<args>]
The most common commands are:
sample Samples the posterior parameters of the model
optimize Optimize the posterior parameters of the model
test Tests the model for numerical issues
See 'model help <command>' for detailed information on a specific command
> ./models/basic_estimators/normal_censored help sample
Bayesian inference with Markov Chain Monte Carlo
Valid subarguments: iter warmup save_warmup thin adapt algorithm
iter
Total number of iterations
Valid values: 0 < iter
Defaults to 2000
warmup
Number of sampling iterations reserved for warmup
Valid values: 0 < warmup
Defaults to 1000
save_warmup
Stream warmup samples to output?
Valid values: [0, 1]
Defaults to 0
thin
Period between saved samples
Valid values: 0 < thin
Defaults to 1
adapt
Warmup Adaptation
Valid subarguments: engaged gamma delta kappa t0
engaged
Adaptation engaged?
Valid values: [0, 1]
Defaults to 0
gamma
Adaptation regularization scale
Valid values: 0 < gamma
Defaults to 0.05
delta
Adaptation target acceptance statistic
Valid values: 0 < delta < 1
Defaults to 0.65
kappa
Adaptation relaxation exponent
Valid values: 0 < kappa
Defaults to 0.75
t0
Adaptation iteration offset
Valid values: 0 < t0
Defaults to 10
algorithm
Sampling algorithm
Valid values: hmc metro
Defaults to hmc
hmc
Hamiltonian Monte Carlo
Valid subarguments: engine metric stepsize stepsize_jitter
engine
Engine for Hamiltonian Monte Carlo
Valid values: static nuts
Defaults to static
static
Static integration time
Valid subarguments: int_time stepsize
int_time
Total integration time for Hamiltonian evolution
Valid values: 0 < int_time
Defaults to 2 * pi
stepsize
Step size for discrete evolution
Valid values: 0 < stepsize
Defaults to 1
nuts
The No-U-Turn Sampler
Valid subarguments: max_depth
max_depth
Maximum tree depth
Valid values: 0 < max_depth
Defaults to 10
metric
Geometry of base manifold
Valid values: unit_e diag_e dense_e
Defaults to unit_e
unit_e
Euclidean manifold with unit metric
diag_e
Euclidean manifold with diag metric
dense_e
Euclidean manifold with dense metric
stepsize
Step size for discrete evolution
Valid values: 0 < stepsize
Defaults to 1
stepsize_jitter
Uniformly random jitter of the stepsize, in percent
Valid values: 0 < stepsize_jitter < 1
Defaults to 0
metro
Random Walk Metropolis Monte Carlo
Valid subarguments:
algorithm={hmc|metropolis}
Hmm, can you give a specific example where unmatched arguments don't cause a failure? That might just be a leaking edge case.
The branch is waaaaaaaaaaay behind develop, and I can take care of merging. There's a bunch of nontrivial stuff to do with some of the arguments anyways.
I'm also happy to tweak the I/O around -- just let me know what you'd prefer to see. Remember, this was just my first attempt with no one else's input.