PythonFan.org
Toggle Menu
Home
Online Python Compiler
Tutorials
Python FastAPI
Python Pandas
Python PyTorch
Python Seaborn
Blog
All Posts
Deep Learning With PyTorch
Challenge yourself with CNNs,RNNs,and transformers.
1. What is the fundamental data structure in PyTorch used for numerical computations?
Tensor
Array
Matrix
DataFrame
2. PyTorch's autograd package automatically computes gradients for tensor operations.
True
False
3. Which of the following are valid activation functions in PyTorch?
ReLU
Sigmoid
Tanh
Linear
4. What does the abbreviation 'CNN' stand for in deep learning?
5. Which PyTorch class is used as the base for defining custom neural networks?
nn.Module
nn.Sequential
nn.Linear
torch.Tensor
6. In PyTorch, the 'backward()' method is called on a loss tensor to compute gradients.
True
False
7. Which of the following are optimizers available in the torch.optim module?
SGD
Adam
RMSprop
GradientDescent
8. What PyTorch function initializes a tensor filled with zeros? (format: torch.zeros)
9. Which method is used to move a PyTorch tensor to a GPU?
.to('cuda')
.gpu()
.device('gpu')
.move('cuda')
10. PyTorch's nn.CrossEntropyLoss combines the LogSoftmax activation and NLLLoss (Negative Log Likelihood Loss).
True
False
11. Which of the following are layer classes in PyTorch's nn module?
nn.Conv2d
nn.Linear
nn.RNN
nn.Activation
12. What is the full form of 'ReLU'?
13. By default, what is the data type of a tensor created with torch.tensor([1, 2, 3])?
torch.float32
torch.int64
torch.float64
torch.int32
14. PyTorch requires manual specification of gradients for all tensor operations.
True
False
15. Which loss functions are suitable for regression tasks in PyTorch?
MSELoss
L1Loss
CrossEntropyLoss
BCELoss
16. Name the PyTorch built-in dataset containing handwritten digit images (abbrev.)
17. Which parameter in a PyTorch tensor enables gradient tracking?
requires_grad=True
track_grad=True
grad_enable=True
autograd=True
18. nn.Sequential is a PyTorch container for stacking modules in sequence, where each module's output is the input to the next.
True
False
19. Which of the following are in-place operations in PyTorch (modify the tensor itself)?
.add_()
.mul()
.sub_()
.div()
20. What PyTorch subpackage provides utilities for loading and preprocessing datasets? (format: torch.utils.data)
Reset
Answered 0 of 0 — 0 correct