Skip to content

Commit

Permalink
Rel 0.2.0 - Initial version of handling nested tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
goedman committed Dec 8, 2023
1 parent 9ea2c1e commit 2084b40
Show file tree
Hide file tree
Showing 17 changed files with 4,447 additions and 4,224 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StanIO"
uuid = "a1b0710c-ff81-4c57-8075-167cfc590dd3"
authors = ["Rob J Goedman <goedman@icloud.com>"]
version = "0.1.4"
version = "0.2.0"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
48 changes: 48 additions & 0 deletions data/brian_data/brian_data.stan
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
generated quantities {
real base = normal_rng(0, 1);
int base_i = to_int(normal_rng(10, 10));

tuple(real, real) pair = (base, base * 2);

tuple(real, tuple(int, complex)) nested = (base * 3, (base_i, base * 4.0i));
array[2] tuple(real, real) arr_pair = {pair, (base * 5, base * 6)};

array[3] tuple(tuple(real, tuple(int, complex)), real) arr_very_nested
= {(nested, base*7), ((base*8, (base_i*2, base*9.0i)), base * 10), (nested, base*11)};

array[3,2] tuple(real, real) arr_2d_pair = {{(base * 12, base * 13), (base * 14, base * 15)},
{(base * 16, base * 17), (base * 18, base * 19)},
{(base * 20, base * 21), (base * 22, base * 23)}};

real basep1 = base + 1, basep2 = base + 2;
real basep3 = base + 3, basep4 = base + 4, basep5 = base + 5;
array[2,3] tuple(array[2] tuple(real, vector[2]), matrix[4,5]) ultimate =
{
{(
{(base, [base *2, base *3]'), (base *4, [base*5, base*6]')},
to_matrix(linspaced_vector(20, 7, 11), 4, 5) * base
),
(
{(basep1, [basep1 *2, basep1 *3]'), (basep1 *4, [basep1*5, basep1*6]')},
to_matrix(linspaced_vector(20, 7, 11), 4, 5) * basep1
),
(
{(basep2, [basep2 *2, basep2 *3]'), (basep2 *4, [basep2*5, basep2*6]')},
to_matrix(linspaced_vector(20, 7, 11), 4, 5) * basep2
)
},
{(
{(basep3, [basep3 *2, basep3 *3]'), (basep3 *4, [basep3*5, basep3*6]')},
to_matrix(linspaced_vector(20, 7, 11), 4, 5) * basep3
),
(
{(basep4, [basep4 *2, basep4 *3]'), (basep4 *4, [basep4*5, basep4*6]')},
to_matrix(linspaced_vector(20, 7, 11), 4, 5) * basep4
),
(
{(basep5, [basep5 *2, basep5 *3]'), (basep5 *4, [basep5*5, basep5*6]')},
to_matrix(linspaced_vector(20, 7, 11), 4, 5) * basep5
)
}};

}
Binary file modified data/mixed_01/mixed_01
Binary file not shown.
2,011 changes: 1,006 additions & 1,005 deletions data/mixed_01/mixed_01_chain_1.csv

Large diffs are not rendered by default.

2,011 changes: 1,006 additions & 1,005 deletions data/mixed_01/mixed_01_chain_2.csv

Large diffs are not rendered by default.

2,011 changes: 1,006 additions & 1,005 deletions data/mixed_01/mixed_01_chain_3.csv

Large diffs are not rendered by default.

2,011 changes: 1,006 additions & 1,005 deletions data/mixed_01/mixed_01_chain_4.csv

Large diffs are not rendered by default.

190 changes: 97 additions & 93 deletions data/mixed_01/mixed_01_log_1.log
Original file line number Diff line number Diff line change
@@ -1,170 +1,174 @@
method = sample (Default)
method = sample (Default)
sample
sample
num_samples = 1000 (Default)
num_samples = 1000 (Default)
num_warmup = 1000 (Default)
num_warmup = 1000 (Default)
save_warmup = 0 (Default)
save_warmup = 0 (Default)
thin = 1 (Default)
method = sample (Default)
adapt
method = sample (Default)
thin = 1 (Default)
engaged = 1 (Default)
method = sample (Default)
gamma = 0.050000 (Default)
sample
num_samples = 1000 (Default)
num_warmup = 1000 (Default)
method = sample (Default)
save_warmup = 0 (Default)
sample
thin = 1 (Default)
delta = 0.800000 (Default)
adapt
gamma = 0.050000 (Default)
num_samples = 1000 (Default)
num_samples = 1000 (Default)
method = sample (Default)
engaged = 1 (Default)
delta = 0.800000 (Default)
num_warmup = 1000 (Default)
num_warmup = 1000 (Default)
sample
gamma = 0.050000 (Default)
kappa = 0.750000 (Default)
save_warmup = 0 (Default)
save_warmup = 0 (Default)
delta = 0.800000 (Default)
num_samples = 1000 (Default)
kappa = 0.750000 (Default)
thin = 1 (Default)
num_warmup = 1000 (Default)
delta = 0.800000 (Default)
adapt
save_warmup = 0 (Default)
t0 = 10.000000 (Default)
engaged = 1 (Default)
thin = 1 (Default)
adapt
adapt
init_buffer = 75 (Default)
kappa = 0.750000 (Default)
init_buffer = 75 (Default)
adapt
gamma = 0.050000 (Default)
term_buffer = 50 (Default)
engaged = 1 (Default)
engaged = 1 (Default)
window = 25 (Default)
t0 = 10.000000 (Default)
gamma = 0.050000 (Default)
gamma = 0.050000 (Default)
init_buffer = 75 (Default)
window = 25 (Default)
delta = 0.800000 (Default)
init_buffer = 75 (Default)
save_metric = 0 (Default)
gamma = 0.050000 (Default)
term_buffer = 50 (Default)
algorithm = hmc (Default)
delta = 0.800000 (Default)
window = 25 (Default)
hmc
kappa = 0.750000 (Default)
kappa = 0.750000 (Default)
algorithm = hmc (Default)
t0 = 10.000000 (Default)
engine = nuts (Default)
hmc
window = 25 (Default)
delta = 0.800000 (Default)
engine = nuts (Default)
save_metric = 0 (Default)
t0 = 10.000000 (Default)
nuts
algorithm = hmc (Default)
init_buffer = 75 (Default)
t0 = 10.000000 (Default)
term_buffer = 50 (Default)
max_depth = 10 (Default)
engine = nuts (Default)
hmc
term_buffer = 50 (Default)
metric = diag_e (Default)
engine = nuts (Default)
window = 25 (Default)
metric_file = (Default)
kappa = 0.750000 (Default)
nuts
init_buffer = 75 (Default)
save_metric = 0 (Default)
metric_file = (Default)
max_depth = 10 (Default)
t0 = 10.000000 (Default)
algorithm = hmc (Default)
stepsize = 1.000000 (Default)
metric = diag_e (Default)
init_buffer = 75 (Default)
hmc
stepsize = 1.000000 (Default)
term_buffer = 50 (Default)
stepsize_jitter = 0.000000 (Default)
window = 25 (Default)
engine = nuts (Default)
max_depth = 10 (Default)
algorithm = hmc (Default)
metric_file = (Default)
window = 25 (Default)
nuts
hmc
metric = diag_e (Default)
stepsize_jitter = 0.000000 (Default)
save_metric = 0 (Default)
max_depth = 10 (Default)
num_chains = 1 (Default)
metric_file = (Default)
algorithm = hmc (Default)
metric = diag_e (Default)
id = 3
engine = nuts (Default)
hmc
stepsize = 1.000000 (Default)
data
metric = diag_e (Default)
nuts
engine = nuts (Default)
metric_file = (Default)
file = (Default)
max_depth = 10 (Default)
nuts
stepsize_jitter = 0.000000 (Default)
init = 2 (Default)
stepsize = 1.000000 (Default)
max_depth = 10 (Default)
random
num_chains = 1 (Default)
stepsize = 1.000000 (Default)
seed = 1270620533 (Default)
stepsize_jitter = 0.000000 (Default)
output
seed = 1302539520 (Default)
id = 2
metric = diag_e (Default)
output
data
stepsize_jitter = 0.000000 (Default)
file = /Users/rob/.julia/dev/StanIO/data/mixed_01/mixed_01_chain_3.csv
num_chains = 1 (Default)
metric_file = (Default)
file = (Default)
num_chains = 1 (Default)
diagnostic_file = (Default)
id = 2
file = /Users/rob/.julia/dev/StanIO/data/mixed_01/mixed_01_chain_3.csv
init = 2 (Default)
id = 1 (Default)
stepsize = 1.000000 (Default)
data
random
diagnostic_file = (Default)
data
seed = 1302539520 (Default)
refresh = 100 (Default)
file = (Default)
file = (Default)
init = 2 (Default)
init = 2 (Default)
random
random
seed = 1270620533 (Default)
sig_figs = 6
output
seed = 1270620533 (Default)
file = /Users/rob/.julia/dev/StanIO/data/mixed_01/mixed_01_chain_1.csv
sig_figs = 6
init = 2 (Default)
profile_file = profile.csv (Default)
diagnostic_file = (Default)
output
random
stepsize = 1.000000 (Default)
save_cmdstan_config = 0 (Default)
refresh = 100 (Default)
seed = 1302539520 (Default)
stepsize_jitter = 0.000000 (Default)
file = /Users/rob/.julia/dev/StanIO/data/mixed_01/mixed_01_chain_2.csv
sig_figs = 6
num_threads = 1 (Default)
output
num_chains = 1 (Default)

file = /Users/rob/.julia/dev/StanIO/data/mixed_01/mixed_01_chain_2.csv
id = 4
num_threads = 1 (Default)
data
profile_file = profile.csv (Default)

diagnostic_file = (Default)
file = (Default)
refresh = 100 (Default)
init = 2 (Default)
diagnostic_file = (Default)
random
seed = 1270620533 (Default)
sig_figs = 6
seed = 1302539520 (Default)
profile_file = profile.csv (Default)
output
save_cmdstan_config = 0 (Default)
file = /Users/rob/.julia/dev/StanIO/data/mixed_01/mixed_01_chain_1.csv
num_threads = 1 (Default)
file = /Users/rob/.julia/dev/StanIO/data/mixed_01/mixed_01_chain_4.csv

diagnostic_file = (Default)
diagnostic_file = (Default)
refresh = 100 (Default)
save_cmdstan_config = 0 (Default)
refresh = 100 (Default)
sig_figs = 6
sig_figs = 6
num_threads = 1 (Default)
profile_file = profile.csv (Default)

save_cmdstan_config = 0 (Default)
sig_figs = 6
profile_file = profile.csv (Default)
save_cmdstan_config = 0 (Default)
num_threads = 1 (Default)

save_cmdstan_config = 0 (Default)
num_threads = 1 (Default)

Model contains no parameters, running fixed_param sampler, no updates to Markov chain
Model contains no parameters, running fixed_param sampler, no updates to Markov chain
Iteration: 1 / 1000 [ 0%] (Sampling)
Iteration: 1 / 1000 [ 0%] (Sampling)
Model contains no parameters, running fixed_param sampler, no updates to Markov chain
Iteration: 1 / 1000 [ 0%] (Sampling)
Model contains no parameters, running fixed_param sampler, no updates to Markov chain
Model contains no parameters, running fixed_param sampler, no updates to Markov chain
Iteration: 1 / 1000 [ 0%] (Sampling)
Iteration: 1 / 1000 [ 0%] (Sampling)
Iteration: 100 / 1000 [ 10%] (Sampling)
Iteration: 100 / 1000 [ 10%] (Sampling)
Expand Down Expand Up @@ -202,27 +206,27 @@ Iteration: 900 / 1000 [ 90%] (Sampling)
Iteration: 900 / 1000 [ 90%] (Sampling)
Iteration: 900 / 1000 [ 90%] (Sampling)
Iteration: 900 / 1000 [ 90%] (Sampling)
Iteration: 1000 / 1000 [100%] (Sampling)
Iteration: 1000 / 1000 [100%] (Sampling)

Elapsed Time: 0 seconds (Warm-up)
0.021 seconds (Sampling)
0.021 seconds (Total)
0.027 seconds (Sampling)
0.027 seconds (Total)

Iteration: 1000 / 1000 [100%] (Sampling)

Iteration: 1000 / 1000 [100%] (Sampling)
Elapsed Time: 0 seconds (Warm-up)
0.021 seconds (Sampling)
0.021 seconds (Total)
0.027 seconds (Sampling)
0.027 seconds (Total)

Iteration: 1000 / 1000 [100%] (Sampling)
Iteration: 1000 / 1000 [100%] (Sampling)

Elapsed Time: 0 seconds (Warm-up)
0.021 seconds (Sampling)
0.021 seconds (Total)
0.028 seconds (Sampling)
0.028 seconds (Total)


Elapsed Time: 0 seconds (Warm-up)
0.021 seconds (Sampling)
0.021 seconds (Total)
0.028 seconds (Sampling)
0.028 seconds (Total)

Loading

0 comments on commit 2084b40

Please sign in to comment.