Make 'partitioning' differentiable/vectorized#70
Merged
Conversation
SarahAlidoost
approved these changes
Jan 13, 2026
Collaborator
SarahAlidoost
left a comment
There was a problem hiding this comment.
@SCiarella thanks for the implementation 👍 . It looks good. Just minor suggestions for docstring.
Regarding your comments on _check_partitioning, I found out the warning is triggered only in the class TestDiffPartitioningGradients and not TestPartitioning. The reason might be the random test values for different parameters. To me this is fine.
Also, another thing to check later is that if the parameters of the Partitioning can be optimized in general (to be discussed in the update meeting?!). If so, we can add a notebook to show the optimization, similar to other modules.
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
|
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 free
to 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.



Target issue #41.
In implementing the partitioning module, I have realized that the x-values of
Afgentables are actually not fully differentiable (seetest_x_breakpoint_at_clampintest_utils.py). I belive that in a real scenario, the user will be interested in optimizing the y-values but not the x-values, so I am just ignoring them intest_partitioning.More than once during the tests the
_check_partitioningwarning gets triggered, suggesting that the sum of the partitions is not 1. To me this behavior looks suspicious, however the tests produce the expected results.