0% found this document useful (0 votes)
3 views4 pages

Deep Learning

The document contains a series of numerical problems and coding tasks related to neural networks, including perceptron output calculations, sigmoid function computations, backpropagation steps, CNN output size calculations, and implementations of neural network components in Python. Each numerical problem requires specific calculations or updates, while the coding tasks involve writing functions and building neural networks using various libraries. The tasks aim to enhance understanding of neural network operations and implementations.

Uploaded by

b4rrel.root
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Deep Learning

The document contains a series of numerical problems and coding tasks related to neural networks, including perceptron output calculations, sigmoid function computations, backpropagation steps, CNN output size calculations, and implementations of neural network components in Python. Each numerical problem requires specific calculations or updates, while the coding tasks involve writing functions and building neural networks using various libraries. The tasks aim to enhance understanding of neural network operations and implementations.

Uploaded by

b4rrel.root
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Numerical 1: Perceptron Output Calculation

A single neuron has:

 Inputs: ( x_1 = 0.6 ), ( x_2 = 0.8 )


 Weights: ( w_1 = 0.5 ), ( w_2 = -0.3 )
 Bias: ( b = 0.2 )

Activation function: Step function

Questions:

1. Compute net input ( z )


2. Find the final output

Numerical 2: Sigmoid Activation Output


Given:

 ( z = 1.2 )

Sigmoid function:

Questions:

1. Compute sigmoid output (approximate to 3 decimal places)


2. Compute derivative of sigmoid at ( z = 1.2 )

Numerical 3: One Step Backpropagation (Output Layer)


Given:

 Predicted output ( \hat{y} = 0.7 )


 Actual output ( y = 1 )
 Learning rate ( \eta = 0.1 )
 Input to output neuron ( x = 0.6 )
 Weight ( w = 0.5 )

Questions:

1. Calculate error
2. Calculate weight update
3. Find new weight
Numerical 4: Hidden Layer Backpropagation
Given:

 Hidden neuron output = 0.5


 Output layer delta = 0.2
 Weight between hidden → output = 0.4
 Sigmoid derivative = 0.25
 Learning rate = 0.1
 Input to hidden neuron = 0.8
 Current hidden weight = 0.3

Questions:

1. Compute hidden layer delta


2. Compute weight update
3. Find new hidden weight

Numerical 5: CNN Output Size Calculation


Input image size = 32 × 32
Filter size = 5 × 5
Stride = 1
Padding = 0

Formula:

Questions:

1. Calculate output size


2. If there are 10 filters, what is final output dimension?

Coding Problem 1: Implement Perceptron from Scratch


Write a Python program to:

1. Implement a single perceptron


2. Use step activation
3. Train it on AND gate dataset
4. Print final weights and outputs

Dataset:

Inputs: [0,0], [0,1], [1,0], [1,1]


Outputs: 0, 0, 0, 1
Coding Problem 2: Implement Sigmoid and Its Derivative
Write Python functions:

 sigmoid(x)
 sigmoid_derivative(x)

Then:

 Compute sigmoid for values [-2, -1, 0, 1, 2]


 Print results

Coding Problem 3: Build a Simple Neural Network Using


NumPy
Create a 1-hidden layer neural network to:

 Take 2 inputs
 2 hidden neurons
 1 output neuron
 Use sigmoid activation
 Perform 1 forward pass only

Print:

 Hidden layer output


 Final output

Coding Problem 4: Implement One Step of


Backpropagation
Using NumPy:

 Define input, weights, target


 Perform forward pass
 Compute error
 Update weights manually
 Print updated weights

Coding Problem 5: Build Neural Network Using


TensorFlow/Keras
Using TensorFlow / Keras:

1. Load MNIST dataset


2. Build simple ANN:
o Input layer
o 1 hidden layer (64 neurons)
o Output layer (10 neurons)
3. Train for 5 epochs
4. Print accuracy

Bonus:

 Plot training accuracy curve

You might also like