Perceptron
Q1. Neural network in simple Numpy.
- Write in plain NumPy the forward and backward pass for a two-layer feed-forward neural network with a ReLU layer in between.
- Implement vanilla dropout for the forward and backward pass in NumPy.
Deep Learning & Generative AI
Interview questions on Neural Networks.
55 questions
Perceptron
Perceptron
Perceptron
Where weights are denoted by wj and biases are denoted by b. Answer the following questions:
Perceptron
Perceptron
Perceptron
Where:
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
tion functions in a MLP. Which ones can never be back-propagated and why?
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
classified samples divided by the total number of incorrectly classified samples.
Perceptron
Perceptron
Perceptron
Perceptron
ImageNet Classification with Deep Convolutional Neural Networks”
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
import torch
nn001 = nn.Sequential(
nn.Linear(200, 512),
nn.Tanh(),
nn.Linear(512, 512),
nn.Tanh(),
nn.Linear(512, 10),
nn.LogSoftmax(dim=1)
)
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
import torchvision
import torch
def main():
vgg11 = torchvision.models.vgg11(pretrained=True)
vgg_layers = vgg11.features
for param in vgg_layers.parameters():
param.requires_grad = False
example = [torch.rand(1, 3, 224, 224),
torch.rand(1, 3, 512, 512),
torch.rand(1, 3, 704, 1024)]
vgg11.eval()
for e in example:
out=vgg_layers(e)
print(out.shape)
if __name__ == "__main__":
main()^^I^^I
Perceptron
vgg_layers=vgg11.features[:3] to the respective input.Perceptron
Perceptron
Perceptron
Perceptron
tensor after the application of the convolutional layer?
Perceptron
Perceptron
Perceptron
Perceptron
import torch
from torch import nn
class MaxPool001(nn.Module):
def __init__(self):
super(MaxPool001, self).__init__()
self.math = torch.nn.Sequential(
torch.nn.Conv2d(3, 32, kernel_size=7, padding=2),
torch.nn.BatchNorm2d(32),
torch.nn.MaxPool2d(2, 2),
torch.nn.MaxPool2d(2, 2),
)
def forward(self, x):
print (x.data.shape)
x = self.math(x)
print (x.data.shape)
x = x.view(x.size(0), -1)
print ("Final shape:{}",x.data.shape)
return x
model = MaxPool001()
model.eval()
x = torch.rand(1, 3, 224, 224)
out=model.forward(x)
The architecture is presented in 9.2:
Perceptron
Perceptron
import scipy
scipy.stats.norm.pdf(x, mu, sigma)
1. Without using Scipy, implement the normal distribution from scratch in Python.
2. Assume, you want to back propagate on the normal distribution, and therefore you need the derivative. Using Scipy write a function for the derivative.
Perceptron
Perceptron
Perceptron
Perceptron
Perceptron
Where: A scientist, constructs a Dropout layer using the following algorithm:
Perceptron
Perceptron
Perceptron