COSIE.model_component.Prediction_mlp

class Prediction_mlp(prediction_dim, activation='relu')[source]

Bases: Module

A fully connected multi-layer perceptron (MLP) for cross-modality prediction between latent embeddings.

Parameters

prediction_dimlist of int

A list defining the hidden dimensions of the MLP prediction module.

activationstr, optional

Activation function to use between hidden layers. Must be one of {‘relu’, ‘sigmoid’, ‘tanh’, ‘leakyrelu’}. Default is ‘relu’.

Methods

forward(x)

Apply the MLP to an input embedding and return predicted embedding.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Methods

forward

Perform full forward pass.

Attributes