Bird
Raised Fist0
ML Pythonml~5 mins

Forward propagation in ML Python - Cheat Sheet & Quick Revision

Choose your learning style10 modes available
Recall & Review
beginner
What is forward propagation in a neural network?
Forward propagation is the process where input data passes through the network layers to produce an output or prediction.
Click to reveal answer
beginner
Why do we use activation functions during forward propagation?
Activation functions add non-linearity to the network, allowing it to learn complex patterns beyond simple linear relationships.
Click to reveal answer
beginner
In forward propagation, what is the role of weights and biases?
Weights scale the input signals, and biases shift them. Together, they help the network adjust outputs to better fit the data.
Click to reveal answer
intermediate
What happens if you skip forward propagation in training a neural network?
Without forward propagation, the network cannot produce predictions or calculate errors, so it cannot learn or improve.
Click to reveal answer
beginner
How is the output of one layer used in forward propagation?
The output of one layer becomes the input to the next layer, passing information forward through the network.
Click to reveal answer
What is the first step in forward propagation?
APassing input data into the network
BCalculating the loss
CUpdating weights
DApplying backpropagation
Which of these is NOT part of forward propagation?
AAdjusting weights based on error
BCalculating weighted sums
CApplying activation functions
DPassing outputs to next layer
Why do we apply activation functions during forward propagation?
ATo reduce input size
BTo calculate loss
CTo add non-linearity
DTo update weights
What does the output of the last layer represent after forward propagation?
AThe input data
BThe error value
CThe updated weights
DThe network's prediction
Which components are combined to calculate the input to a neuron during forward propagation?
ALearning rate and momentum
BWeights, biases, and inputs
CActivation and error
DLoss and accuracy
Explain the steps of forward propagation in a simple neural network.
Think about how data moves from input to output through each layer.
You got /5 concepts.
    Why is forward propagation important for training a neural network?
    Consider what would happen if the network could not produce outputs.
    You got /4 concepts.

      Practice

      (1/5)
      1. What is the main purpose of forward propagation in a neural network?
      easy
      A. To pass input data through the network to get predictions
      B. To update the weights using gradients
      C. To split data into training and testing sets
      D. To initialize the weights randomly

      Solution

      1. Step 1: Understand forward propagation role

        Forward propagation is the process where input data moves through the network layers to produce output predictions.
      2. Step 2: Differentiate from other processes

        Updating weights and splitting data are separate steps, not part of forward propagation.
      3. Final Answer:

        To pass input data through the network to get predictions -> Option A
      4. Quick Check:

        Forward propagation = prediction step [OK]
      Hint: Forward propagation = input to output prediction [OK]
      Common Mistakes:
      • Confusing forward propagation with training steps
      • Thinking it updates weights
      • Mixing it with data preparation
      2. Which of the following is the correct formula for calculating the output of a neuron during forward propagation?
      easy
      A. output = input / weight - bias
      B. output = weight + input * bias
      C. output = activation(input - weight + bias)
      D. output = activation(weight * input + bias)

      Solution

      1. Step 1: Recall neuron output formula

        The neuron output is calculated by multiplying input by weight, adding bias, then applying activation.
      2. Step 2: Match formula to options

        output = activation(weight * input + bias) correctly shows output = activation(weight * input + bias).
      3. Final Answer:

        output = activation(weight * input + bias) -> Option D
      4. Quick Check:

        Neuron output = weighted sum + bias, then activation [OK]
      Hint: Neuron output = activation(weight x input + bias) [OK]
      Common Mistakes:
      • Mixing order of operations
      • Forgetting to apply activation function
      • Using addition instead of multiplication for weights
      3. Given a single neuron with weight = 0.5, bias = 1, input = 4, and activation function f(x) = x (identity), what is the output after forward propagation?
      medium
      A. 3.5
      B. 3.0
      C. 4.0
      D. 2.0

      Solution

      1. Step 1: Calculate weighted sum

        Weighted sum = weight * input + bias = 0.5 * 4 + 1 = 2 + 1 = 3.
      2. Step 2: Apply activation function

        Activation is identity, so output = 3.
      3. Final Answer:

        3.0 -> Option B
      4. Quick Check:

        Output = 0.5x4 + 1 = 3.0 [OK]
      Hint: Multiply weight and input, add bias, then activate [OK]
      Common Mistakes:
      • Adding weight and input instead of multiplying
      • Forgetting bias
      • Misapplying activation function
      4. Consider this Python code for forward propagation of a single neuron:
      def forward(input, weight, bias):
          return input * weight + bias
      
      output = forward(3, 2, 1)
      print(output)
      What is the error in this code if the activation function is missing?
      medium
      A. The code misses applying the activation function, so output is not transformed
      B. The multiplication operator is wrong, should be '+' instead of '*'
      C. The bias should be multiplied, not added
      D. The function should return input + weight + bias instead

      Solution

      1. Step 1: Analyze the function output

        The function returns weighted sum without applying any activation function.
      2. Step 2: Understand activation role

        Activation function adds non-linearity; missing it means output is raw sum, which is incomplete forward propagation.
      3. Final Answer:

        The code misses applying the activation function, so output is not transformed -> Option A
      4. Quick Check:

        Activation missing = incomplete forward propagation [OK]
      Hint: Always apply activation after weighted sum [OK]
      Common Mistakes:
      • Thinking bias should be multiplied
      • Confusing operators
      • Ignoring activation importance
      5. You have a 2-layer neural network where the first layer outputs [2, 3] and the second layer has weights [[1, -1], [0, 2]] and biases [0, 1]. Using ReLU activation f(x) = max(0, x), what is the output of the second layer after forward propagation?
      hard
      A. [3, 4]
      B. [2, 5]
      C. [0, 7]
      D. [1, 6]

      Solution

      1. Step 1: Calculate weighted sums for second layer

        Multiply first layer output by weights and add biases: For first neuron: (2*1) + (3*0) + 0 = 2 + 0 + 0 = 2 For second neuron: (2*(-1)) + (3*2) + 1 = -2 + 6 + 1 = 5
      2. Step 2: Apply ReLU activation

        ReLU outputs max(0, x): First neuron: max(0, 2) = 2 Second neuron: max(0, 5) = 5
      3. Step 3: Re-check calculations for correctness

        Re-examining weights and biases: Weights matrix: [[1, -1], [0, 2]] means first output neuron weights: [1, -1] Second output neuron weights: [0, 2] Input vector: [2, 3] Calculations: Neuron 1: 2*1 + 3*(-1) + 0 = 2 - 3 + 0 = -1 Neuron 2: 2*0 + 3*2 + 1 = 0 + 6 + 1 = 7 Apply ReLU: Neuron 1: max(0, -1) = 0 Neuron 2: max(0, 7) = 7
      4. Final Answer:

        [0, 7] -> Option C
      5. Quick Check:

        Weighted sum + bias, then ReLU = [0, 7] [OK]
      Hint: Multiply inputs by weights, add bias, apply ReLU [OK]
      Common Mistakes:
      • Mixing weight matrix rows and columns
      • Forgetting to add bias
      • Applying activation before weighted sum
      Recommended

      Ready to prove it?

      Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

      10 questions~5 mineasy hard