# UNIT TEST COMMENT: Candidate for Table Driven Tests
# UNQ_C4 GRADED FUNCTION: back_prop
def back_prop(x, yhat, y, h, W1, W2, b1, b2, batch_size):
'''
Inputs:
x: average one hot vector for the context
yhat: prediction (estimate of y)
y: target vector
h: hidden vector (see eq. 1)
W1, W2, b1, b2: matrices and biases
batch_size: batch size
Outputs:
grad_W1, grad_W2, grad_b1, grad_b2: gradients of matrices and biases
'''
### START CODE HERE (Replace instanes of 'None' with your code) ###
# {Moderator's Edit: Solution Code Removed}
### END CODE HERE ####
print(f'batch_size = {batch_size} and x.shape = {x.shape}')
return grad_W1, grad_W2, grad_b1, grad_b2
Hey @DURGESH_RAO,
Please check out the following thread. For future references, it is strictly against the community guidelines to share the solution code publicly. You are more than welcome to share your error stack.
Cheers,
Elemento