# Encoders

class multimodal_compare.models.encoders.Enc_CNN(latent_dim, data_dim, latent_private)

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(x)

    Forward pass

    Parameters:

      x (list, torch.tensor) – data batch

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_FNN(latent_dim, data_dim, latent_private)

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(x)

    Forward pass

    Parameters:

      x (list, torch.tensor) – data batch

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_MNIST(latent_dim, data_dim, latent_private)

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(x)

    Forward pass

    Parameters:

      x (torch.tensor) – data batch

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_MNIST2(latent_dim, data_dim, latent_private, num_hidden_layers=1)

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(x)

    Forward pass

    Parameters:

      x (list, torch.tensor) – data batch

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_PolyMNIST(latent_dim, data_dim, latent_private)

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(x)

    Forward pass

    Parameters:

      x (list, torch.tensor) – data batch

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_SVHN(latent_dim, data_dim, latent_private)

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(x)

    Forward pass

    Parameters:

      x (list, torch.tensor) – data batch

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_SVHN2(latent_dim, data_dim, latent_private)

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(x)

    Forward pass

    Parameters:

      x (list, torch.tensor) – data batch

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_Transformer(latent_dim, data_dim, latent_private, ff_size=1024, num_layers=8, num_heads=2, dropout=0.1, activation='gelu')

  Bases: `VaeEncoder`

  Transformer VAE as implemented in https://github.com/Mathux/ACTOR

  _is_full_backward_hook: bool | None
  forward(batch)

    Forward pass

    Parameters:

      batch (list, torch.tensor) – list of a data batch and boolean masks for the sequences

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_TransformerIMG(latent_dim, data_dim, latent_private, ff_size=1024, num_layers=8, num_heads=4, dropout=0.1, activation='gelu')

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(batch)

    Forward pass

    Parameters:

      batch (list, torch.tensor) – list of a data batch and boolean masks for the sequences

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_TxtTransformer(latent_dim, data_dim, latent_private, ff_size=1024, num_layers=8, num_heads=2, dropout=0.1, activation='gelu')

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(batch)

    Forward pass

    Parameters:

      batch (list, torch.tensor) – list of a data batch and boolean masks for the sequences

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.Enc_VideoGPT(latent_dim, data_dim, latent_private, n_res_layers=4, downsample=(2, 4, 4))

  Bases: `VaeEncoder`

  _is_full_backward_hook: bool | None
  forward(x)

    Forward pass

    Parameters:

      x (list, torch.tensor) – data batch

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.VaeComponent(latent_dim: int, data_dim: tuple, latent_private=None, net_type=NetworkTypes.UNSPECIFIED, net_role=NetworkRoles.UNSPECIFIED)

  Bases: `Module`

  _is_full_backward_hook: bool | None
  abstract forward(x)

    Forward pass

    Parameters:

      x (list, torch.tensor) – data batch

    Returns:

      tensor of means, tensor of log variances

    Return type:

      tuple(torch.tensor, torch.tensor)

  training: bool

class multimodal_compare.models.encoders.VaeEncoder(latent_dim, data_dim, latent_private, net_type: NetworkTypes)

  Bases: `VaeComponent`

  _backward_hooks: Dict[int, Callable]
  _buffers: Dict[str, Tensor | None]
  _forward_hooks: Dict[int, Callable]
  _forward_pre_hooks: Dict[int, Callable]
  _is_full_backward_hook: bool | None
  _load_state_dict_post_hooks: Dict[int, Callable]
  _load_state_dict_pre_hooks: Dict[int, Callable]
  _modules: Dict[str, 'Module' | None]
  _non_persistent_buffers_set: Set[str]
  _parameters: Dict[str, Parameter | None]
  _state_dict_hooks: Dict[int, Callable]
  training: bool

multimodal_compare.models.encoders.extra_hidden_layer(hidden_dim)