Add support for custom adjacency context in masked autoregressive transform #65
Merged
francois-rozet merged 4 commits intoApr 13, 2025
Conversation
Member
francois-rozet
left a comment
There was a problem hiding this comment.
Hi @aalmodovares, I reviewed the proposed changes. These look very appropriate, and the tests as well. Good job! I left a few comments, mainly regarding variable names and a bit of formatting. Tell me if you agree with the suggested changes. I will merge right after. Thanks a lot!
Contributor
Author
|
Hi @francois-rozet. Thank you for accepting my PR! I agree with all your suggestions, I have implemented them already and checked everything works. All the suggestions are solved. Thank you also for the brevity. Feel free to reach me again if something can be improved! :) |
Member
|
The PR has been merged 🥳 Very good job on your first contribution to Zuko! |
Contributor
Author
|
Thank you!! I would be glad to collaborate again! |
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.
This PR implements #64, adding support for user-defined structural constraints in the context features of MaskedAutoregressiveTransform.
Allows specifying an adjacency matrix of shape (features, features + context).
The right-most columns correspond to context-related constraints.
Adds assertions to verify shape validity.
Includes a test to ensure correct behavior.
No additional assumptions are made about the structure of the context adjacency beyond its shape.
Feel free to suggest any changes or additional constraints to enforce.