I am getting following Error for Cost FUnction, can anyobidy guide me what am I doing wrong.
TypeError Traceback (most recent call last)
in
1 A2, t_Y = compute_cost_test_case()
----> 2 cost = compute_cost(A2, t_Y)
3 print("cost = " + str(compute_cost(A2, t_Y)))
4
5 compute_cost_test(compute_cost)
in compute_cost(A2, Y)
21 # cost = β¦
22 # YOUR CODE STARTS HERE
β> 23 cost = np.multiply(-1/m,np.sum(np.dot(np.log(A2),Y.T),np.dot(np.log(1-A2),(1-Y).T)))
24 # YOUR CODE ENDS HERE
25
<array_function internals> in sum(*args, **kwargs)
/opt/conda/lib/python3.7/site-packages/numpy/core/fromnumeric.py in sum(a, axis, dtype, out, keepdims, initial, where)
2227
2228 return _wrapreduction(a, np.add, βsumβ, axis, dtype, out, keepdims=keepdims,
β 2229 initial=initial, where=where)
2230
2231
/opt/conda/lib/python3.7/site-packages/numpy/core/fromnumeric.py in _wrapreduction(obj, ufunc, method, axis, dtype, out, **kwargs)
88 return reduction(axis=axis, out=out, **passkwargs)
89
β> 90 return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
91
92
TypeError: only integer scalar arrays can be converted to a scalar index