sparsity of the jacobian of a program #9
Merged
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.
Given a program, enhances it to compute the sparsity of the Jacobian of that program by tracking which input indices are used in which output indices.
See examples at the end of the file.
If there are no branch cuts in the given function which result in different sparsity patterns, the sparsity can be computed once and reused, if not, we will need to run it on inputs that will take all the branch cuts and find the union of them. I'm looking for test cases with branch cuts that are not just
max
andmin
. :)It's possible that something like ConcolicFuzzer's approach may figure out inputs that will take all branches.
Thanks to @vchuravy for teaching me some Cassette and compilation stuff!
TODO:
broadcast
takes a long time!