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

Transfer-learning allow additional fragtypes #421

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mo-sameh
Copy link
Collaborator

Using the functionality introduced in peptdeep PR.
To allow finetuning a pretrained model to be able to predict different number of charged_frag_types while using the pretrained backbone as a starting point for the weights.

Copy link
Collaborator

@mschwoer mschwoer left a comment

Choose a reason for hiding this comment

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

LGTM

assert (
self._train_fraction + self._validation_fraction + self._test_fraction
<= 1.0
), "The sum of the train, validation and test fractions should be less than or equal to 1.0"
super().__init__(mask_modloss, device, self.charged_frag_types)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer calling this init still at the top..

def ...(..):
    charged_frag_types = (
            get_charged_frag_types(fragment_types, max_charge)
            if fragment_types
            else None
        )
   super().__init__(mask_modloss, device, charged_frag_types)

   self.charged_frag_types = charged_frag_types
...

I did not find a proper resource, but I feel the parent init should be called "as early as possible"
https://stackoverflow.com/a/77975817

@@ -0,0 +1,480 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

A small initial description of what the purpose of this nb is would be nice

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