plot_hyperparameter_search_results

behavenet.plotting.cond_ae_utils.plot_hyperparameter_search_results(lab, expt, animal, session, n_labels, label_names, alpha_weights, alpha_n_ae_latents, alpha_expt_name, beta_weights, beta_n_ae_latents, beta_expt_name, alpha, beta, save_file, batch_size=None, format='pdf', **kwargs)[source]

Create a variety of diagnostic plots to assess the ps-vae hyperparameters.

These diagnostic plots are based on the recommended way to perform a hyperparameter search in the ps-vae models; first, fix beta=1, and do a sweep over alpha values and number of latents (for example alpha=[50, 100, 500, 1000] and n_ae_latents=[2, 4, 8, 16]). The best alpha value is subjective because it involves a tradeoff between pixel mse and label mse. After choosing a suitable value, fix alpha and the number of latents and vary beta. This function will then plot the following panels:

  • pixel mse as a function of alpha/num latents (for fixed beta)

  • label mse as a function of alpha/num_latents (for fixed beta)

  • pixel mse as a function of beta (for fixed alpha/n_ae_latents)

  • label mse as a function of beta (for fixed alpha/n_ae_latents)

  • index-code mutual information (part of the KL decomposition) as a function of beta (for fixed alpha/n_ae_latents)

  • total correlation(part of the KL decomposition) as a function of beta (for fixed alpha/n_ae_latents)

  • dimension-wise KL (part of the KL decomposition) as a function of beta (for fixed alpha/n_ae_latents)

  • average correlation coefficient across all pairs of unsupervised latent dims as a function of beta (for fixed alpha/n_ae_latents)

Parameters:
  • lab (str) – lab id

  • expt (str) – expt id

  • animal (str) – animal id

  • session (str) – session id

  • n_labels (str) – number of label dims

  • label_names (array-like) – names of label dims

  • alpha_weights (array-like) – array of alpha weights for fixed values of beta

  • alpha_n_ae_latents (array-like) – array of latent dimensionalities for fixed values of beta using alpha_weights

  • alpha_expt_name (str) – test-tube experiment name of alpha-based hyperparam search

  • beta_weights (array-like) – array of beta weights for a fixed value of alpha

  • beta_n_ae_latents (int) – latent dimensionality used for beta hyperparam search

  • beta_expt_name (str) – test-tube experiment name of beta hyperparam search

  • alpha (float) – fixed value of alpha for beta search

  • beta (float) – fixed value of beta for alpha search

  • save_file (str) – absolute path of save file; does not need file extension

  • batch_size (int, optional) – size of batches, used to compute correlation coefficient per batch; if NoneType, the correlation coefficient is computed across all time points

  • format (str, optional) – format of saved image; ‘pdf’ | ‘png’ | ‘jpeg’ | …

  • kwargs – arguments are keys of hparams, preceded by either alpha_ or beta_. For example, to set the train frac of the alpha models, use alpha_train_frac; to set the rng_data_seed of the beta models, use beta_rng_data_seed.