def nn_model(X, Y, num_iterations, lambd, learning_rate, print_cost=True):
    costs = []
    (W, b) = initialize_parameters(X.shape[0])
    for i in range(num_iterations):
        (grads, cost) = prop(W, b, X, Y, lambd)
        dW = grads['dW']
        db = grads['db']
        W = (W - (learning_rate * dW))
        b = (b - (learning_rate * db))
        if (print_cost and ((i % 1000) == 0)):
            print(('cost after iteration %i: %f' % (i, cost)))
            costs.append(cost)
    parameters = {'W': W, 'b': b}
    grads = {'dW': dW, 'db': db}
    return (parameters, costs)
def nn_model(X, Y, num_iterations, lambd, learning_rate, print_cost=True):
    costs = []
    (W, b) = initialize_parameters(X.shape[0])
    for i in range(num_iterations):
        (grads, cost) = prop(W, b, X, Y, lambd)
        dW = grads['dW']
        db = grads['db']
        W = (W - (learning_rate * dW))
        b = (b - (learning_rate * db))
        if (print_cost and ((i % 1000) == 0)):
            print(('cost after iteration %i: %f' % (i, cost)))
            costs.append(cost)
    parameters = {'W': W, 'b': b}
    grads = {'dW': dW, 'db': db}
    return (parameters, costs)