Question: Please explain as best you can how to get the answer(with theory) and I will give you a thumbs up. Don't simply use chat GPT.

Please explain as best you can how to get the answer(with theory) and I will give you a thumbs up. Don't simply use chat GPT.Please explain as best you can how to get the answer(with theory)

Determine the output of the following programs. Hints: nn.Flatten() will not flatten the batch size dimension. list (z) will returns z as a list object. For example, print(list(torch.zeros ([64,1,28,28]). size())) will print [64,1,28,28]. (i) import torch import torch.nn as nn batch_size =64 x=torchzeros([ batch_size, 1, 28, 28]) x=nn. Conv2d(in_channels =1, out_channels =8, kernel_size =3, stride =1, padding =0)(x) print( list (x.size ())) x=nn MaxPool2d(kernel_size =2, stride =2, padding =0)(x) print( list (x.size ())) x=nnFlatten()(x) print(list(xsize())) (6 marks) (ii) import torch import torch.nn as nn batch_size =64 x= torch.zeros ([batch_size, 1, 28, 28]) x=nn. Conv2d(in_channels =1, out_channels =8, kernel_size =3, stride =1, padding =1)(x) print( list (x.size ())) x=nn MaxPool2d(kernel_size =2, stride =2, padding =0)(x) print (list (x.size ())) x=nnFlatten()(x) print( list (xsize())) (6 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!