feat: add window training modes for signal/background regions#8
Open
kratsg wants to merge 1 commit into
Open
Conversation
Implements modes 3 and 4 from the GitHub issue to extend cabin's cut learning capabilities: - Mode 3 (window_keep): Automatically learn windows to keep signal events - Duplicates inputs to learn both upper and lower bounds (x1 < x < x2) - Uses fixed weights [+1, -1] pairs with learnable biases - Replaces need to manually pass inputs twice with different signs - Mode 4 (window_reject): Learn rejection windows for background events - Dual network architecture: acceptance + rejection networks - Learns regions where (x < x1 || x > x2) to reject background - Final output: accept_prob * (1.0 - reject_prob) Key changes: - Enhanced OneToOneLinear with mode parameter and input expansion - Added DualNetworkLinear class for dual network approach - Updated EfficiencyScanNetwork to support different training modes - Modified loss functions to handle window cuts regularization - Comprehensive tests covering all modes with backward compatibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.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.
Summary
window_keep)window_reject)Implementation Details
Mode 3: Window Keep (
mode="window_keep")[+1, -1]pairs with learnable biasesx1 < x < x2(original_features, 2)shaped tensorMode 4: Window Reject (
mode="window_reject")accept_prob * (1.0 - reject_prob)x < x1 || x > x2Architecture Changes
OneToOneLinearwith mode parameter and input expansion logicDualNetworkLinearclass for dual network approachEfficiencyScanNetworkto support different training modesTest Plan
Usage Examples
🤖 Generated with Claude Code