Skip to content
New issue

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

Add a method of providing initial values, including from Python/R scripts #139

Open
WardBrian opened this issue Jul 23, 2024 · 6 comments
Open
Labels
Milestone

Comments

@WardBrian
Copy link
Collaborator

For initial values, we can similarly allow a magic variable called inits or initialize which should be set to a function that takes in the chain ID and returns initial values. This nicely side-steps the UI issues of how to support multiple initial values for the multiple chains.

@magland
Copy link
Collaborator

magland commented Jul 23, 2024

I think we should hash out exactly how this would work. I have some questions about it. Maybe we can chat in person tomorrow?

@WardBrian
Copy link
Collaborator Author

Sure -- it's also by no means a priority, I just wanted to split the older issue up so we could close it as the main part was completed

@magland
Copy link
Collaborator

magland commented Jul 25, 2024

Are we thinking initial.json in the project? Or is this something that would be called dynamically at the beginning of sampling? I'm uneasy about the latter for a couple reasons. But I'll save those reasons until after I get a better idea of what you had in mind.

@WardBrian
Copy link
Collaborator Author

initial.json in the project is fine if you're initializing all chains at the same point. It becomes problematic when you have different initial values for each chain (which is recommended), as you'd need a variable number of them depending on the current sampling options.

@magland
Copy link
Collaborator

magland commented Jul 25, 2024

That makes sense. But I feel like using data.py/data.R for this is problematic. For data, you run it manually and it replaces the data.json, whereas for inits, it runs automatically and presumably it does not replace data.json at that time. If it needs to be dynamic at the start of sampling, then I think it should be a separate inits.py/inits.R.

Another way to do this is to have data.py handle both... and creates both data.json and inits.json, based on the sampling opts which are available to the script. And when you go to do sampling, if the number of chains does not match inits.json, then you get a helpful error message and know to rerun data.py (or manually paste in new content for inits.json)

@WardBrian WardBrian changed the title Allow data.py/data.r to provide initial values Add a method of providing initial values, including from Python/R scripts Jul 26, 2024
@WardBrian
Copy link
Collaborator Author

Sure. I've updated the issue title to reflect that this might not necessarily re-use the data generation files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants