fusilli.fusionmodels.tabularimagefusion.concat_img_maps_tabular_mapsο
Concatenating the feature maps of the first tabular modality and the feature maps of the image modality.
Classes
|
Concatenating the feature maps of the first tabular modalities and the feature maps of the image modality. |
- class ConcatImageMapsTabularMaps(prediction_task, data_dims, multiclass_dimensions)[source]ο
Bases:
ParentFusionModel,ModuleConcatenating the feature maps of the first tabular modalities and the feature maps of the image modality.
- prediction_taskο
Type of prediction to be performed.
- Type:
str
- mod1_layersο
Dictionary containing the layers of the first modality. Calculated in the
set_mod1_layers()method.- Type:
nn.ModuleDict
- img_layersο
Dictionary containing the layers of the image data. Calculated in the
set_img_layers()method.- Type:
nn.ModuleDict
- fused_dimο
Number of features of the fused layers. In this method, itβs the size of the tabular layers output plus the size of the (flattened) image layers output.
- Type:
int
- fused_layersο
Sequential layer containing the fused layers. Calculated in the
calc_fused_layers()method.- Type:
nn.Sequential
- final_predictionο
Sequential layer containing the final prediction layers. The final prediction layers take in the number of features of the fused layers as input. Calculated in the
calc_fused_layers()method.- Type:
nn.Sequential
- __init__(prediction_task, data_dims, multiclass_dimensions)[source]ο
- Parameters:
prediction_task (str) β Type of prediction to be performed.
data_dims (list) β List containing the dimensions of the data.
multiclass_dimensions (int) β Number of classes in the multiclass classification task.
- forward(x1, x2)[source]ο
Forward pass of the model.
- Parameters:
x1 (torch.Tensor) β Input tensor for the first tabular modality.
x2 (torch.Tensor) β Input tensor for the image modality.
- Returns:
Fused prediction.
- Return type:
torch.Tensor
- fusion_type = 'operation'ο
Type of fusion.
- Type:
str
- method_name = 'Concatenating tabular and image feature maps'ο
Name of the method.
- Type:
str
- modality_type = 'tabular_image'ο
Type of modality.
- Type:
str