Uh oh!
There was an error while loading. Please reload this page.
[feature request] Add ffi interface for logp-gradient function - #600
Closed
aseyboldt wants to merge 1 commit into
Closed
[feature request] Add ffi interface for logp-gradient function#600aseyboldt wants to merge 1 commit into
aseyboldt wants to merge 1 commit into
Conversation
riddell-stan
commented
Jun 16, 2022
Contributor
Feature requests need to be proposed and discussed on the Stan Forums first. The issue tracker is for bugs and confirmed features only. |
aseyboldt
commented
Jun 16, 2022
ContributorAuthor
@riddell-stan Sorry, I didn't realize that. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current shared object build for each stan model includes a function for computing the logp gradient, but calling this function is relatively slow as it converts the dataset each time. This PR adds a couple of functions that make it possible to call the gradient function from a C or numba library without any python overhead:
function_addressis now a pointer to a C function:Which is way faster than the previously exported gradient function.
This is useful for implementing different samplers based on stan models (for example the sampler implemented in rust that I'm working on ;-) ).