ModelABC¶
- class mfai.pytorch.models.base.ModelABC[source]¶
Bases:
ABC- abstract property features_last: bool¶
Indicates if the features are the last dimension in the input/output tensors. Conv and ViT typically have features as the second dimension (Batch, Features, …) versus GNNs for which features are the last dimension (Batch, …, Features).
- abstract property num_spatial_dims: int¶
Returns the number of spatial dimensions of the instanciated model.
- abstract property supported_num_spatial_dims: tuple[int, ...]¶
Returns the number of input spatial dimensions supported by the model. A 2d vision model supporting (H, W) should return (2,). A model supporting both 2d and 3d inputs (by settings) should return (2, 3). Once instanciated the model will be in 2d OR 3d mode.