-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Update log_prob method to take constrained_params in init format #1108
Update log_prob method to take constrained_params in init format #1108
Conversation
Thanks for looking into this @andrjohns. I guess the downside to this approach is losing the ability to 'batch' calls? |
Yeah pretty much. I was thinking an option would be to have multiple files, like how the inits are handled, but I'm not sure if that would be just as messy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding the doc strings for the classes. just a few minor issues left that go beyond the doc and then this is good to go
Sorry for the delay in getting to this @bob-carpenter! Ready for another look now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never understood the design of CmdStan and find the code almost impossible to read as the boundary conditions all seems strange.
My main concern is that none of this seems to be tested, but then there may be tests elsewhere.
I'd be much more comfortable if you found someone other than me who actually understands the C++ in CmdStan to review.
@WardBrian I've updated the test model to include various containers (to make that the un-constraining works correctly), and verified that the returned values are consistent with those returned by |
The doc needs work here.
What does this mean? The init argument takes a specification for a single point, whereas it looks like this function is going to allow multiple points. Something needs to specify what that format is.
|
Digging deeper through the source, it looks like there's an option to include or not include the Jacobian adjustment. I still think this is going to be confusing unless there is very clear doc about what the user should expect. I see everything got changed at one point to Finally, I've never understood the structure of CmdStan, so I'd rather not be the reviewer here. |
If you’d like to not be the reviewer, you will still need to remove your existing “request changes”. We can then ask @rok-cesnovar to review? |
I don't feel qualified to review CmdStan code.
Thanks for letting me know. I just dismissed my review. I'd forgotten I looked at this a month ago and that suggestions submitted that way shouldn't be in the form of a review. It does look like there are tests now, which is great. And the user-facing doc I think is important to clarify should go in the CmdStan docs, not here in the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Some user facing doc would be great, but that is outside of the scope of this repo.
Submisison Checklist
./runCmdStanTests.py src/test
Summary:
Updates the recently added
log_prob
method so that theconstrained_params
argument expects its inputs to follow the same format/structure as theinit
argument for sampling/optimisationIntended Effect:
Simpler usage of the
log_prob
methodHow to Verify:
Additional tests included
Side Effects:
N/A
Documentation:
Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Andrew Johnson
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: