deepof.hypermodels.Contrastive

class deepof.hypermodels.Contrastive(input_shape: tuple, latent_dim: int, learn_rate: float = 0.001, edge_feature_shape: tuple | None = None, use_gnn: bool = False, adjacency_matrix: ndarray | None = None)

Hyperparameter tuning pipeline for deepof.models.Contrastive.

__init__(input_shape: tuple, latent_dim: int, learn_rate: float = 0.001, edge_feature_shape: tuple | None = None, use_gnn: bool = False, adjacency_matrix: ndarray | None = None)

Contrastive hypermodel for hyperparameter tuning.

Parameters:
  • input_shape (tuple) – shape of the input tensor.

  • latent_dim (int) – dimension of the latent space.

  • learn_rate (float) – learning rate for the optimizer.

  • edge_feature_shape (tuple) – shape of the edge feature tensor.

  • use_gnn (bool) – whether to use a graph neural network to encode the input data.

  • adjacency_matrix (np.ndarray) – adjacency matrix of the graph.

Methods

__init__(input_shape, latent_dim[, ...])

Contrastive hypermodel for hyperparameter tuning.

build(hp)

Override Hypermodel's build method.

declare_hyperparameters(hp)

fit(hp, model, *args, **kwargs)

Train the model.

get_hparams(hp)

Retrieve hyperparameters to tune, including the encoder type and the weight of the kmeans loss.

__init__(input_shape: tuple, latent_dim: int, learn_rate: float = 0.001, edge_feature_shape: tuple | None = None, use_gnn: bool = False, adjacency_matrix: ndarray | None = None)

Contrastive hypermodel for hyperparameter tuning.

Parameters:
  • input_shape (tuple) – shape of the input tensor.

  • latent_dim (int) – dimension of the latent space.

  • learn_rate (float) – learning rate for the optimizer.

  • edge_feature_shape (tuple) – shape of the edge feature tensor.

  • use_gnn (bool) – whether to use a graph neural network to encode the input data.

  • adjacency_matrix (np.ndarray) – adjacency matrix of the graph.