pyluna-pathology.luna.pathology.models package¶
Submodules¶
pyluna-pathology.luna.pathology.models.eng_tissuenet module¶
load_classifier Modified version of [1], rewritten to load tissue classifier models trained by the MIND team. [1] https://github.com/msk-mind/data-processing/blob/refactor-cli-fix-tests/data_processing.pathology/models/tissuenet.py
- luna.pathology.models.eng_tissuenet.get_classifier(checkpoint_path: str = '/gpfs/mskmindhdp_emc/user/shared_data_folder/kohlia/tile_classifier/ckpts/1.ckpt', n_classes: int = 5)[source]¶
loads a model from a checkpoint and unpacks the network
- Parameters
checkpoint_path (str) – path to model checkpoint
n_classes – number of classes used in training, used to set final layer in PyTorch model
- Returns
PyTorch module with loaded weights
- Return type
nn.Module
pyluna-pathology.luna.pathology.models.ov_tissuenet module¶
- class luna.pathology.models.ov_tissuenet.TissueTileNet(model, n_classes, activation=None)[source]¶
Bases:
torch.nn.modules.module.Module- forward(x)[source]¶
Defines 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.
- training: bool¶