Skip to content

Add documentation to MusicBertNoteEncoder class - #7

Merged
manoskary merged 2 commits into
codex/integrate-musicbert-with-note-level-predictionfrom
copilot/sub-pr-6
Jan 8, 2026
Merged

Add documentation to MusicBertNoteEncoder class#7
manoskary merged 2 commits into
codex/integrate-musicbert-with-note-level-predictionfrom
copilot/sub-pr-6

Conversation

Copilot AI commented Jan 8, 2026

Copy link
Copy Markdown

Addresses review feedback requesting documentation for the MusicBertNoteEncoder class to explain its architecture and two-stage encoding process.

Changes

  • Class-level docstring: Documents the two-stage architecture (MusicBERT token embedding → token-to-note pooling) and parameter usage including LoRA adapter configuration
  • Forward method docstring: Specifies input/output tensor shapes and the token-to-note alignment mechanism

The documentation clarifies how token-level MusicBERT embeddings are aggregated into note-level representations using weighted pooling based on alignment edges.

class MusicBertNoteEncoder(nn.Module):
    """Note-level encoder using MusicBERT with token-to-note pooling.
    
    This encoder implements a two-stage process for generating note-level representations
    from tokenized musical sequences:
    
    1. Token Embedding: A pretrained MusicBERT backbone (transformers AutoModel) encodes
       the input token sequence into contextualized token embeddings.
    2. Token-to-Note Pooling: A TokenToNotePooler aggregates token embeddings into 
       note-level representations using weighted pooling based on token-to-note alignments.
    ...
    """

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: manoskary <26930454+manoskary@users.noreply.github.com>
Copilot AI changed the title [WIP] Update tests for MusicBERT token-to-note pooling Add documentation to MusicBertNoteEncoder class Jan 8, 2026
Copilot AI requested a review from manoskary January 8, 2026 13:50
@manoskary
manoskary marked this pull request as ready for review January 8, 2026 13:55
@manoskary
manoskary merged commit b5a2d37 into codex/integrate-musicbert-with-note-level-prediction Jan 8, 2026
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.

2 participants