We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make two inits files, inits1.json and inits2.json. They can both just contain {}. Run
inits1.json
inits2.json
{}
import os from cmdstanpy import CmdStanModel, cmdstan_path bernoulli_dir = os.path.join(cmdstan_path(), 'examples', 'bernoulli') stan_file = os.path.join(bernoulli_dir, 'bernoulli.stan') model = CmdStanModel(stan_file=stan_file) data = {"N": 10, "y": [0, 1, 0, 0, 0, 0, 0, 0, 0, 1]} model.sample(data=data, chains=2, inits=['inits1.json', 'inits2.json'], output_dir='.', force_one_process_per_chain=False)
Open the resulting output files, both will have used inits1.json
To make this even more obvious, you can make inits2.json contain something that would fail to initialize, like {'theta':4.0}
{'theta':4.0}
This is related to #362 and #685
The text was updated successfully, but these errors were encountered:
Oh, the correct behavior is worth noting:
You need a base filename, like init.json, which can be used to "infer" the filenames per chain, which look like init_1.json, init_2.json
init.json
init_1.json
init_2.json
This isn't too hard to make work, but getting it to collaborate with the historical multiprocessing approach is belabored.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Summary:
Make two inits files,
inits1.json
andinits2.json
. They can both just contain{}
.Run
Open the resulting output files, both will have used
inits1.json
To make this even more obvious, you can make
inits2.json
contain something that would fail to initialize, like{'theta':4.0}
Additional Information:
This is related to #362 and #685
The text was updated successfully, but these errors were encountered: