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

Test functions with constraints on arguments #99

Open
devmotion opened this issue Jan 2, 2021 · 1 comment
Open

Test functions with constraints on arguments #99

devmotion opened this issue Jan 2, 2021 · 1 comment

Comments

@devmotion
Copy link
Member

Related to JuliaDiff/FiniteDifferences.jl#52, it seems there is currently no way to specify constraints on function arguments to FiniteDifferences. For instance, when testing the ChainRule adjoint of (an extension of) binomlogpdf(n, p, x) input p has to be constrained to the interval [0, 1] since otherwise the forward pass errors.

@devmotion
Copy link
Member Author

In DistributionsAD we introduced a custom way to specify mappings from R^n to the desired subspace to avoid these issues in our tests (see, e.g., https://github.com/TuringLang/DistributionsAD.jl/blob/d5a479acc90acd9fe42f1abd207788c164ac85af/test/ad/distributions.jl#L252)

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

No branches or pull requests

1 participant