0
0
ML Pythonml~10 mins

Forward propagation in ML Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to calculate the weighted sum in forward propagation.

ML Python
weighted_sum = sum(inputs[i] * weights[i] for i in range(len(inputs))) + [1]
Drag options to blanks, or click blank then click option'
Abias
Bactivation
Coutput
Dloss
Attempts:
3 left
💡 Hint
Common Mistakes
Using activation instead of bias in the weighted sum.
Forgetting to add bias at all.
2fill in blank
medium

Complete the code to apply the activation function in forward propagation.

ML Python
output = [1](weighted_sum)
Drag options to blanks, or click blank then click option'
Aactivation_function
Blen
Cprint
Dsum
Attempts:
3 left
💡 Hint
Common Mistakes
Using sum instead of activation_function.
Trying to print the weighted sum instead of applying activation.
3fill in blank
hard

Fix the error in the code to correctly compute the output of a neuron.

ML Python
output = activation_function([1])
Drag options to blanks, or click blank then click option'
Ainputs
Bweighted_sum
Cweights
Dbias
Attempts:
3 left
💡 Hint
Common Mistakes
Applying activation function directly to inputs or weights.
Using bias alone as input to activation.
4fill in blank
hard

Fill both blanks to complete the forward propagation step for one neuron.

ML Python
weighted_sum = sum([1][i] * [2][i] for i in range(len(inputs))) + bias
Drag options to blanks, or click blank then click option'
Ainputs
Bweights
Cbias
Doutput
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping inputs and weights in multiplication.
Including bias inside the loop.
5fill in blank
hard

Fill all three blanks to complete the forward propagation for a layer of neurons.

ML Python
outputs = [activation_function(sum([1][i] * [2][j][i] for i in range(len([3]))) + biases[j]) for j in range(len(weights))]
Drag options to blanks, or click blank then click option'
Ainputs
Bweights
Dbiases
Attempts:
3 left
💡 Hint
Common Mistakes
Using biases instead of inputs in the sum.
Mixing up weights and biases indices.