Path: blob/master/notebooks/book1/20/ae_mnist_conv.ipynb
1192 views
Kernel: Python 3 (ipykernel)
In [14]:
Out[14]:
/content/scripts
In [15]:
Out[15]:
Requirement already satisfied: superimport in /usr/local/lib/python3.7/dist-packages (0.3.4)
Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from superimport) (2.23.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->superimport) (2021.10.8)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->superimport) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->superimport) (2.10)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->superimport) (1.24.3)
In [16]:
In [17]:
In [5]:
Out[5]:
INFO:torch.distributed.nn.jit.instantiator:Created a temporary directory at /tmp/tmp9mi2rheu
INFO:torch.distributed.nn.jit.instantiator:Writing /tmp/tmp9mi2rheu/_remote_module_non_sriptable.py
ConvAE(
(vae): ConvAEModule(
(enc_convs): ModuleList(
(0): Conv2d(1, 28, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
(1): BatchNorm2d(28, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): LeakyReLU(negative_slope=0.01)
(3): Conv2d(28, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
(4): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(5): LeakyReLU(negative_slope=0.01)
(6): Conv2d(64, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
(7): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(8): LeakyReLU(negative_slope=0.01)
)
(mu_linear): Sequential(
(0): Linear(in_features=1024, out_features=20, bias=True)
(1): LeakyReLU(negative_slope=0.01)
(2): Dropout(p=0.2, inplace=False)
)
(log_var_linear): Sequential(
(0): Linear(in_features=1024, out_features=20, bias=True)
(1): LeakyReLU(negative_slope=0.01)
(2): Dropout(p=0.2, inplace=False)
)
(decoder_linear): Sequential(
(0): Linear(in_features=20, out_features=1024, bias=True)
(1): LeakyReLU(negative_slope=0.01)
(2): Dropout(p=0.2, inplace=False)
)
(dec_t_convs): ModuleList(
(0): UpsamplingNearest2d(scale_factor=2.0, mode=nearest)
(1): ConvTranspose2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(3): LeakyReLU(negative_slope=0.01)
(4): UpsamplingNearest2d(scale_factor=2.0, mode=nearest)
(5): ConvTranspose2d(64, 28, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(6): BatchNorm2d(28, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(7): LeakyReLU(negative_slope=0.01)
(8): UpsamplingNearest2d(scale_factor=2.0, mode=nearest)
(9): ConvTranspose2d(28, 1, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(10): Sigmoid()
)
)
)
In [18]:
Out[18]:
ConvAE(
(vae): ConvAEModule(
(enc_convs): ModuleList(
(0): Conv2d(1, 28, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
(1): LeakyReLU(negative_slope=0.01)
(2): Conv2d(28, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
(3): LeakyReLU(negative_slope=0.01)
(4): Conv2d(64, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
(5): LeakyReLU(negative_slope=0.01)
)
(mu_linear): Linear(in_features=1024, out_features=2, bias=True)
(log_var_linear): Linear(in_features=1024, out_features=2, bias=True)
(decoder_linear): Linear(in_features=2, out_features=1024, bias=True)
(dec_t_convs): ModuleList(
(0): UpsamplingNearest2d(scale_factor=2.0, mode=nearest)
(1): ConvTranspose2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(2): LeakyReLU(negative_slope=0.01)
(3): UpsamplingNearest2d(scale_factor=2.0, mode=nearest)
(4): ConvTranspose2d(64, 28, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(5): LeakyReLU(negative_slope=0.01)
(6): UpsamplingNearest2d(scale_factor=2.0, mode=nearest)
(7): ConvTranspose2d(28, 1, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(8): Sigmoid()
)
)
)
In [19]:
Out[19]:
/usr/local/lib/python3.7/dist-packages/probml_utils/plotting.py:79: UserWarning: set FIG_DIR environment variable to save figures
warnings.warn("set FIG_DIR environment variable to save figures")
In [20]:
Out[20]:
/usr/local/lib/python3.7/dist-packages/probml_utils/plotting.py:79: UserWarning: set FIG_DIR environment variable to save figures
warnings.warn("set FIG_DIR environment variable to save figures")
In [21]:
Out[21]:
/usr/local/lib/python3.7/dist-packages/probml_utils/plotting.py:79: UserWarning: set FIG_DIR environment variable to save figures
warnings.warn("set FIG_DIR environment variable to save figures")
In [22]:
Out[22]:
/usr/local/lib/python3.7/dist-packages/probml_utils/plotting.py:79: UserWarning: set FIG_DIR environment variable to save figures
warnings.warn("set FIG_DIR environment variable to save figures")
In [23]:
Out[23]:
<matplotlib.image.AxesImage at 0x7f451b8b1bd0>
In [24]:
Out[24]:
<matplotlib.image.AxesImage at 0x7f451b822250>
In [25]:
Out[25]:
/usr/local/lib/python3.7/dist-packages/sklearn/manifold/_t_sne.py:783: FutureWarning: The default initialization in TSNE will change from 'random' to 'pca' in 1.2.
FutureWarning,
/usr/local/lib/python3.7/dist-packages/sklearn/manifold/_t_sne.py:793: FutureWarning: The default learning rate in TSNE will change from 200.0 to 'auto' in 1.2.
FutureWarning,
In [26]:
Out[26]:
/usr/local/lib/python3.7/dist-packages/sklearn/manifold/_t_sne.py:783: FutureWarning: The default initialization in TSNE will change from 'random' to 'pca' in 1.2.
FutureWarning,
/usr/local/lib/python3.7/dist-packages/sklearn/manifold/_t_sne.py:793: FutureWarning: The default learning rate in TSNE will change from 200.0 to 'auto' in 1.2.
FutureWarning,
/usr/local/lib/python3.7/dist-packages/probml_utils/plotting.py:79: UserWarning: set FIG_DIR environment variable to save figures
warnings.warn("set FIG_DIR environment variable to save figures")
In [27]:
Out[27]:
In [28]:
Out[28]:
/usr/local/lib/python3.7/dist-packages/probml_utils/plotting.py:79: UserWarning: set FIG_DIR environment variable to save figures
warnings.warn("set FIG_DIR environment variable to save figures")
In [29]:
Out[29]:
<matplotlib.image.AxesImage at 0x7f451b8e4150>
In [30]:
Out[30]:
<matplotlib.image.AxesImage at 0x7f451b9a5790>
In [31]:
Out[31]:
/usr/local/lib/python3.7/dist-packages/probml_utils/plotting.py:79: UserWarning: set FIG_DIR environment variable to save figures
warnings.warn("set FIG_DIR environment variable to save figures")
In [32]:
Out[32]:
/usr/local/lib/python3.7/dist-packages/probml_utils/plotting.py:79: UserWarning: set FIG_DIR environment variable to save figures
warnings.warn("set FIG_DIR environment variable to save figures")