deepof.model_utils.tune_search
- deepof.model_utils.tune_search(preprocessed_object: tuple, adjacency_matrix: ndarray, encoding_size: int, embedding_model: str, hypertun_trials: int, hpt_type: str, k: int, project_name: str, callbacks: List, batch_size: int = 1024, n_epochs: int = 30, n_replicas: int = 1, outpath: str = 'unsupervised_tuner_search') tuple
Define the search space using keras-tuner and hyperband or bayesian optimization.
- Parameters:
preprocessed_object (tf.data.Dataset) – Dataset object for training and validation.
adjacency_matrix (np.ndarray) – Adjacency matrix for the graph.
encoding_size (int) – Size of the encoding layer.
embedding_model (str) – Model to use to embed and cluster the data. Must be one of VQVAE (default), VaDE, and Contrastive.
hypertun_trials (int) – Number of hypertuning trials to run.
hpt_type (str) – Type of hypertuning to run. Must be one of “hyperband” or “bayesian”.
k (int) – Number of clusters on the latent space.
kmeans_loss (float) – Weight of the kmeans loss, which enforces disentanglement by penalizing the correlation between dimensions in the latent space.
project_name (str) – Name of the project.
callbacks (List) – List of callbacks to use.
batch_size (int) – Batch size to use.
n_epochs (int) – Maximum number of epochs to train for.
n_replicas (int) – Number of replicas to use.
outpath (str) – Path to save the results.
- Returns:
Dictionary of the best hyperparameters. best_run (str): Name of the best run.
- Return type:
best_hparams (dict)