def L1(yhat, y):
“”"
Arguments:
yhat – vector of size m (predicted labels)
y – vector of size m (true labels)
Returns:
loss -- the value of the L1 loss function defined above
"""
#(≈ 1 line of code)
# loss =
# YOUR CODE STARTS HERE
loss = np.sum(y-yhat)
L1. Check your equations and avoid using global variables inside the function.