Professional Documents
Culture Documents
Capsule
28
Input shape: (1, 28, 28)
Apply a CNN with the following parameters 28
● Input channel = 1
● Output channel = 256
● Kernel size = 9
● Stride = 2
● Padding = 0
● Input channel = 1
● Output channel = 256
● Kernel size = 9
● Stride = 2
● Padding = 0
u1 = conv_list[0](input)
print(u1.shape)
Apply the 1st CNN in the set to the input
The shape of the output (u1) is:
Input is the output from previous step
Input shape: (256, 20, 20)
Define a set of 8 CNNs with the following parameters for each CNN
● Input channel = 256 conv_list = nn.ModuleList([nn.Conv2d(
in_channels=256,
● Output channel = 32
out_channels=32,
● Kernel size = 9 kernel_size=9,
● Stride = 2 stride=2,
● Padding = 0 padding=0) for _ in range(8)])
u1 = conv_list[0](input)
print(u1.shape)
Apply the 1st CNN in the set to the input
The shape of the output (u1) is: 32 6 6
Apply the all 8 CNNs from the set to the input and stack the output together.
The stacking will create a new dimension, this will be the 1st dimension.
conv_list = nn.ModuleList([nn.Conv2d(
in_channels=256,
out_channels=32,
kernel_size=9,
stride=2,
padding=0) for _ in range(8)])
The stacking will create a new dimension, this will be the 1st dimension.
conv_list = nn.ModuleList([nn.Conv2d(
in_channels=256,
out_channels=32,
kernel_size=9,
stride=2,
padding=0) for _ in range(8)])
u = u.view((-1, 8))
print(u.shape)
u = u.view((-1, 8))
print(u.shape)
The last FC layer output a 1-dimension vector. What is the shape of this vector in order to
reconstruct the original digit image?
Assume that we use the following decoder structure to reconstruct a digit.
The last FC layer output a 1-dimension vector. What is the shape of this vector in order to
reconstruct the original digit image?
Answer: 784 (28x28)
Thank you