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

Adding Charged Fragment Types to MS2 Model Weights #228

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

mo-sameh
Copy link
Collaborator

This PR introduces a small but useful modification to the MS2 model interface and ModelMS2Bert,by including charged fragment types as an attribute within the model weights. With this change, charged fragment types are saved and loaded from disk, making it easier to adjust fragment types for prediction and training.

Main Benefits

  • More flexibility in training and inference
    • Supports partial weight loading to continue training with different fragment types (as suggested in PR allow partial loading for pre trained ms2 models #226).
    • Allows prediction with any subset of supported fragment types, including masking modloss fragments—removing the need for a separate mask_modloss argument.
  • Better handling of unsupported fragment types
    • Now raises clear and interpretable errors when an invalid fragment type is requested.

I've added a notebook (adapt_charged_fragtypes.ipynb) that walks through different use cases, including compatibility with older weight formats. It would be great if you could take a look and let me know if anything is missing.

This update modifies ModelMS2Bert, but if this approach looks good, I’d be happy to extend it to other architectures in a follow-up PR.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mo-sameh mo-sameh requested a review from GeorgWa February 12, 2025 18:51
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