WEEK 2 Assignment — ANN Fundamentals
Section A — Theory Questions
Q1. Why do we need activation functions in neural networks?
Explain:
• Sigmoid
• ReLU
• Tanh
Q2. What is Gradient Descent?
Explain:
• Learning Rate
• Cost Function
• How weights are updated
Section B — Practical Coding
Q3. Python Implementation
Write a Python program to:
• Take 2 inputs
• Calculate weighted sum
• Apply Sigmoid activation
• Print final output
Q4. Simple Weight Update using Gradient Descent
Write a Python program to:
• Initialize weight = 5
• Learning rate = 0.1
• Gradient = 2
Update the weight using Gradient Descent formula and print the new weight.
Use:
Where:
• η = learning rate
• dL/dw = gradient
Q5. Write a program which can compute the factorial of a given numbers.