peptdeep.model.rt¶
Classes:
|
ModelInterface for RT models |
|
Transformer model for RT prediction |
|
CNN+LSTM model for RT prediction |
- class peptdeep.model.rt.AlphaRTModel(dropout=0.1, model_class: Module = <class 'peptdeep.model.rt.Model_RT_LSTM_CNN'>, device: str = 'gpu', **kwargs)[source][source]¶
Bases:
ModelInterfaceModelInterface for RT models
Methods:
__init__([dropout])add_irt_column_to_precursor_df(precursor_df)test(precursor_df, *[, batch_size])- __init__(dropout=0.1, model_class: Module = <class 'peptdeep.model.rt.Model_RT_LSTM_CNN'>, 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.rt.Model_RT_Bert(dropout=0.1, nlayers=4, hidden=128, output_attentions=False, **kwargs)[source][source]¶
Bases:
ModuleTransformer model for RT prediction
Methods:
__init__([dropout, nlayers, hidden, ...])Initialize internal Module state, shared by both nn.Module and ScriptModule.
forward(aa_indices, mod_x)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)[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¶
- peptdeep.model.rt.Model_RT_LSTM[source]¶
alias of
Model_RT_LSTM_CNN
- class peptdeep.model.rt.Model_RT_LSTM_CNN(dropout=0.2)[source][source]¶
Bases:
ModuleCNN+LSTM model for RT prediction
Methods:
__init__([dropout])Initialize internal Module state, shared by both nn.Module and ScriptModule.
forward(aa_indices, mod_x)Define the computation performed at every call.
- __init__(dropout=0.2)[source][source]¶
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(aa_indices, mod_x)[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.