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

Make optimizers raise an error when provided negative fixed features #2603

Closed
wants to merge 1 commit into from

Conversation

esantorella
Copy link
Member

Summary:
Context: See #2602

This PR:

  • Adds a check for negative fixed_features keys to input validation for optimizers. This applies to all of the optimizers that take fixed_features.
  • Updates docstrings

Differential Revision: D65272024

Summary:
Context: See pytorch#2602

This PR:
* Adds a check for negative fixed_features keys to input validation for optimizers. This applies to all of the optimizers that take fixed_features.
* Updates docstrings

Differential Revision: D65272024
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Oct 31, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D65272024

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.98%. Comparing base (66660e3) to head (26b86e0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2603   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         196      196           
  Lines       17370    17372    +2     
=======================================
+ Hits        17368    17370    +2     
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Balandat Balandat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good to get this in for now, but I feel like it shouldn't be to hard to allow this by canonicalizing the indices to index % num_features? Being able to use backward indexing can be quite convenient. Maybe we can make a backlog task for this?

@esantorella
Copy link
Member Author

I think it's good to get this in for now, but I feel like it shouldn't be to hard to allow this by canonicalizing the indices to index % num_features? Being able to use backward indexing can be quite convenient. Maybe we can make a backlog task for this?

That makes sense to me. I didn't want to do it right now since I'd want to check a lot more carefully that that wouldn't break anything (e.g. if there were a place in the code that added a feature as the last column).

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 9e44749.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants