mtenn.model.LigandOnlyModel
- class mtenn.model.LigandOnlyModel(model, readout=None, fix_device=False)[source]
Bases:
ModelA ligand-only version of the
Model. In this case, therepresentationblock will hold the entire model, while thestrategyblock will simply be set as an Identity module.Methods
__init__(model[, readout, fix_device])Build a
LigandOnlyModel.forward(rep)Handles all the logic detailed in the docs page.
- __init__(model, readout=None, fix_device=False)[source]
Build a
LigandOnlyModel.- Parameters:
model – This can be any kind of model that will go from a single input representation to a prediction (eg a
GAT <mtenn.conversion_utils.gat.GATinstance)fix_device (bool, default=False) – If True, make sure the input is on the same device as the model, copying over as necessary.
- forward(rep)[source]
Handles all the logic detailed in the docs page.
- Parameters:
rep – Whatever input representation the unerlying model takes
- Returns:
torch.Tensor – Final model prediction. If the model has a
readout, this value will have thereadoutappliedlist[torch.Tensor] – A list containing only the pre-
readoutmodel prediction. This value is returned mainly to align the signatures for the single- and multi-pose models