peptdeep.model.ccs¶
Classes:
|
ModelInterface for Model_CCS_LSTM or Model_CCS_Bert |
|
Transformer model for CCS prediction |
|
LSTM model for CCS prediction |
Functions:
|
Add 'mobility_pred' into precursor_df inplace |
|
Add 'ccs' into precursor_df inplace |
- class peptdeep.model.ccs.AlphaCCSModel(dropout=0.1, model_class: Module = <class 'peptdeep.model.ccs.Model_CCS_LSTM'>, device: str = 'gpu', **kwargs)[source][source]¶
Bases:
ModelInterfaceModelInterface for Model_CCS_LSTM or Model_CCS_Bert
Methods:
__init__([dropout])ccs_to_mobility_pred(precursor_df)test(precursor_df, *[, x, y, batch_size])- __init__(dropout=0.1, model_class: Module = <class 'peptdeep.model.ccs.Model_CCS_LSTM'>, device: str = 'gpu', **kwargs)[source][source]¶
- Parameters:
device (str, optional) – device type in ‘get_available’, ‘cpu’, ‘mps’, ‘gpu’ (or ‘cuda’), by default ‘gpu’
fixed_sequence_len (int, optional) – See
fixed_sequence_len, defaults to 0.min_pred_value (float, optional) – See
min_pred_value, defaults to 0.0.
- class peptdeep.model.ccs.Model_CCS_Bert(dropout=0.1, nlayers=4, hidden=128, output_attentions=False, **kwargs)[source][source]¶
Bases:
ModuleTransformer model for CCS prediction
Methods:
__init__([dropout, nlayers, hidden, ...])Initialize internal Module state, shared by both nn.Module and ScriptModule.
forward(aa_indices, mod_x, charges)Define the computation performed at every call.
Attributes:
- __init__(dropout=0.1, nlayers=4, hidden=128, output_attentions=False, **kwargs)[source][source]¶
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(aa_indices, mod_x, charges: Tensor)[source][source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- property output_attentions¶
- class peptdeep.model.ccs.Model_CCS_LSTM(dropout=0.1)[source][source]¶
Bases:
ModuleLSTM model for CCS prediction
Methods:
__init__([dropout])Initialize internal Module state, shared by both nn.Module and ScriptModule.
forward(aa_indices, mod_x, charges)Define the computation performed at every call.
- __init__(dropout=0.1)[source][source]¶
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(aa_indices, mod_x, charges)[source][source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.