fusilli.fusionmodels.tabularfusion.activationο
Activation-function fusion model for tabular data.
Classes
|
Performs an element wise product of the feature maps of the two tabular modalities, tanh activation function and sigmoid activation function. |
- class ActivationFusion(prediction_task, data_dims, multiclass_dimensions)[source]ο
Bases:
ParentFusionModel
,Module
Performs an element wise product of the feature maps of the two tabular modalities, tanh activation function and sigmoid activation function. Afterwards the the first tabular modality feature map is concatenated with the fused feature map.
- 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
- mod2_layersο
Dictionary containing the layers of the second modality. Calculated in the
set_mod2_layers()
method.- Type:
nn.ModuleDict
- fused_dimο
Number of features of the fused layers. In this method, itβs the size of the tabular 1 layers output plus the size of the tabular 2 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 problem.
- forward(x)[source]ο
Forward pass of the model.
- Parameters:
x (tuple) β Tuple containing the input data.
- Returns:
List containing the output of the model.
- Return type:
list
- fusion_type = 'operation'ο
Type of fusion.
- Type:
str
- get_fused_dim()[source]ο
Get the number of features of the fused layers. Assuming mod1_layers and mod2_layers output the same dimension.
- method_name = 'Activation function map fusion'ο
Name of the method.
- Type:
str
- modality_type = 'tabular_tabular'ο
Type of modality.
- Type:
str