From c2b222aeb91ddaf661954453cb24b77f9ba3c70d Mon Sep 17 00:00:00 2001 From: AI Industries Date: Tue, 21 Sep 2021 22:07:36 +1000 Subject: [PATCH 1/2] Update README.md KeyError Fix: remove apostrophe's from experiment commands between lines 25-51 --- README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 72c0554..27430d0 100644 --- a/README.md +++ b/README.md @@ -22,33 +22,33 @@ For more information on making a Weight & Biases account see [(creating a weight ## Running an experiment To rerun the experiment from Figure 3, you can run: -- `tvae --name 'tvae_2d_mnist'` +- `tvae --name tvae_2d_mnist` To rerun the experiments from Figure 4, you can run: -- `tvae --name 'tvae_Lpartial_mnist'` -- `tvae --name 'tvae_Lpartial_dsprites'` +- `tvae --name tvae_Lpartial_mnist` +- `tvae --name tvae_Lpartial_dsprites` To rerun the experiments from Tables 1, you can run: -- `tvae --name 'tvae_Lhalf_mnist'` -- `tvae --name 'tvae_Lshort_mnist'` -- `tvae --name 'bubbles_mnist'` -- `tvae --name 'tvae_L0_mnist'` -- `tvae --name 'nontvae_mnist'` +- `tvae --name tvae_Lhalf_mnist` +- `tvae --name tvae_Lshort_mnist` +- `tvae --name bubbles_mnist` +- `tvae --name tvae_L0_mnist` +- `tvae --name nontvae_mnist` To rerun the experiments from Tables 2, you can run: -- `tvae --name 'tvae_Lhalf_dsprites'` -- `tvae --name 'tvae_Lpartial_dsprites'` -- `tvae --name 'tvae_Lshort_dsprites'` -- `tvae --name 'bubbles_dsprites'` -- `tvae --name 'tvae_L0_dsprites'` -- `tvae --name 'nontvae_dsprites'` +- `tvae --name tvae_Lhalf_dsprites` +- `tvae --name tvae_Lpartial_dsprites` +- `tvae --name tvae_Lshort_dsprites` +- `tvae --name bubbles_dsprites` +- `tvae --name tvae_L0_dsprites` +- `tvae --name nontvae_dsprites` To rerun the generalization experiment described in Section B.4 (resulting in Figures 1 and 6), you can run: -- `tvae --name 'tvae_Lpartial_mnist_generalization'` +- `tvae --name tvae_Lpartial_mnist_generalization` To rerun the experiments from Figures 22 and 23 (training on complex combined transformations), you can run: -- `tvae --name 'tvae_Lpartial_perspective_mnist'` -- `tvae --name 'tvae_Lpartial_rotcolor_mnist'` +- `tvae --name tvae_Lpartial_perspective_mnist` +- `tvae --name tvae_Lpartial_rotcolor_mnist` ## Basics of the framework - All models are built using the `TVAE` module (see `tvae/containers/tvae.py`) which requires a z-encoder, a u-encoder, a decoder, and a 'grouper'. The grouper module defines the topographic structure of the latent space through a `model` (equivalent to W in the paper), and a `padder` which defines the boundary conditions. From 690d845123da633eb2a997e1df76766446e50307 Mon Sep 17 00:00:00 2001 From: AI Industries Date: Thu, 23 Sep 2021 14:17:38 +1000 Subject: [PATCH 2/2] Update train_loops.py Fix file name error due to asterisk --- tvae/utils/train_loops.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tvae/utils/train_loops.py b/tvae/utils/train_loops.py index f62ec7f..af9dfea 100644 --- a/tvae/utils/train_loops.py +++ b/tvae/utils/train_loops.py @@ -49,7 +49,7 @@ def train_epoch(model, optimizer, train_loader, log, savepath, epoch, eval_batch model.plot_decoder_weights(wandb_on=wandb_on) model.plot_encoder_weights(wandb_on=wandb_on) - Plot_Covariance_Matrix(s**2.0, s**2.0, name='Covariance_S**2_batch', wandb_on=wandb_on) + Plot_Covariance_Matrix(s**2.0, s**2.0, name='Covariance_Sxx2_batch', wandb_on=wandb_on) if plot_fullcaptrav: model.plot_capsule_traversal(x_batched.detach(), @@ -122,7 +122,7 @@ def eval_epoch(model, val_loader, log, savepath, epoch, n_is_samples=100, all_labels = torch.cat(all_labels, 0) if plot_cov: Plot_Covariance_Matrix(all_s, all_s, name='Covariance_S_Full', wandb_on=wandb_on) - Plot_Covariance_Matrix(all_s**2.0, all_s**2.0, name='Covariance_S**2_Full', wandb_on=wandb_on) + Plot_Covariance_Matrix(all_s**2.0, all_s**2.0, name='Covariance_Sxx2_Full', wandb_on=wandb_on) if plot_maxact: Plot_MaxActImg(all_s, all_x, os.path.join(savepath, 'samples'), epoch, wandb_on=wandb_on) if plot_class_selectivity: @@ -184,7 +184,7 @@ def train_epoch_dsprites(model, optimizer, train_loader, log, savepath, epoch, e model.plot_decoder_weights(wandb_on=wandb_on) model.plot_encoder_weights(wandb_on=wandb_on) - Plot_Covariance_Matrix(s**2.0, s**2.0, name='Covariance_S**2_batch', wandb_on=wandb_on) + Plot_Covariance_Matrix(s**2.0, s**2.0, name='Covariance_Sxx2_batch', wandb_on=wandb_on) if plot_fullcaptrav: model.plot_capsule_traversal(x_batched.detach(), @@ -205,4 +205,4 @@ def train_epoch_dsprites(model, optimizer, train_loader, log, savepath, epoch, e for t in cap_offsets: total_cap_corr[t] = np.corrcoef(cap_offsets[t], true_offsets[t])[0,1] - return total_loss, total_neg_logpx_z, total_kl, total_eq_loss, total_cap_corr, num_batches \ No newline at end of file + return total_loss, total_neg_logpx_z, total_kl, total_eq_loss, total_cap_corr, num_batches