fusilli.fusionmodels.unimodal.image

Unimodal model using only the image data.

Classes

ImgUnimodal(prediction_task,Β data_dims,Β ...)

A uni-modal model using only the image data.

class ImgUnimodal(prediction_task, data_dims, multiclass_dimensions)[source]

Bases: ParentFusionModel, Module

A uni-modal model using only the image data.

img_layers

Dictionary containing the layers of the image data.

Type:

nn.ModuleDict

fused_dim

Number of features of the fused layers. This is the flattened output size of the image layers.

Type:

int

fused_layers

Sequential layer containing the fused layers.

Type:

nn.Sequential

final_prediction

Sequential layer containing the final prediction layers.

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.

calc_fused_layers()[source]

Calculates the fused layers.

Return type:

None

forward(x)[source]

Forward pass of the model.

Parameters:

x (torch.Tensor) – Tensor containing the image data.

Returns:

out_pred – List containing the predictions.

Return type:

list

fusion_type = 'unimodal'

Type of fusion.

Type:

str

get_fused_dim()[source]

Get the number of features of the fused layers.

Return type:

None

method_name = 'Image unimodal'

Name of the method.

Type:

str

modality_type = 'img'

Type of modality.

Type:

str