Skip to content

Add per-head event weights for multi-head classification - #36

Open
AvencastF wants to merge 1 commit into
mainfrom
multi-head-dev
Open

Add per-head event weights for multi-head classification#36
AvencastF wants to merge 1 commit into
mainfrom
multi-head-dev

Conversation

@AvencastF

Copy link
Copy Markdown
Contributor

Summary

Adds first-class independent event-weight support for multi-head classification.

  • Accepts head -> Tensor[N] weight mappings for training, validation, and evaluation.
  • Preserves shared single-tensor weights and the existing single-head API.
  • Applies each head’s weights to its unreduced event losses, normalized by active weight sum.
  • Excludes ignore_index (-100) rows from losses and metrics per head.
  • Rejects sampler="weighted" with per-head mappings because no sampling-combination policy is defined.
  • Adds validation, batching, evaluation/export support, CPU-focused tests, and documentation.

Why

Previously multi-head labels supported mappings, but weight mappings failed when the dataset attempted to convert the dictionary into a tensor.

Validation

  • Static compilation and whitespace checks passed.
  • Runtime tests require a Python environment with PyTorch; the available environment did not include it.

@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant