BoxELPPI
- class mowl.models.BoxELPPI(*args, **kwargs)[source]
Bases:
BoxELExample of BoxEL for protein-protein interaction prediction.
Customizes negative sampling to use only protein IDs from the evaluation classes instead of all ontology classes.
Attributes Summary
Methods Summary
generate_negatives(gci_name, gci_dataset)Generate negative samples for a given GCI type.
Returns the active negative sampling configuration.
Attributes Documentation
- protein_ids
Methods Documentation
- generate_negatives(gci_name, gci_dataset)[source]
Generate negative samples for a given GCI type.
Override this method for custom negative sampling strategies.
- Parameters:
gci_name (str) – Name of the GCI type (e.g., ‘gci2’)
gci_dataset (torch.Tensor) – The dataset containing positive samples
- Returns:
Negative samples tensor, or None if no negatives for this GCI type
- Return type:
torch.Tensor or None
- get_negative_sampling_config()[source]
Returns the active negative sampling configuration.
When
neg_sampling_gcisisNone(the default), the configuration is derived automatically from the intersection of_DEFAULT_NEG_SAMPLING_CONFIGand the module’sneg_capable_gcis— so only GCIs that the module genuinely supports are included.When
neg_sampling_gcisis set explicitly, only those GCIs are included. Training will raiseNotImplementedErrorif any of them are absent fromneg_capable_gcis.Override this method to customise which GCI types require negative sampling and how negatives should be generated.
- Returns:
Dictionary mapping GCI names to their negative sampling config. Each entry has:
'index_pool':'classes'or'individuals'— pool to sample from'corrupt_column': int — which column of the data tensor to replace
- Return type: