it is possible to use both L2 regularization and dropout
np.sum
没有指明维度,那么np.sum计算的是整个矩阵的和
### START CODE HERE ### (approx. 1 line)
L2_regularization_cost = np.sum((np.sum(np.square(W1)),np.sum(np.square(W2)),np.sum(np.square(W3))))*lambd/(2*m)
L2_regularization_cost 适合于希望超参数少的情况,现在只需要调lambd
如果lambd太大的话,分类就会太“平滑”,导致高偏差.