def update(parameters, grads, learning_rate):
    """
    利用梯度下降更新参数
    Args:
        parameters: 参数信息:
                    parameters['W' + str(i)] = Wi
                    parameters['b' + str(i)] = bi
        grads: 每个参数的梯度:
                    grads['dW' + str(i)] = dWi
                    grads['db' + str(i)] = dbi
        learning_rate: 学习步长
    Return:
        parameters: 更新后的参数
    """

    n = len(parameters) // 2  # 神经网络的层数

    # 参数更新策略
    for k in range(n):
        parameters["W" + str(k + 1)] = \
            parameters["W" + str(k + 1)] - \
            learning_rate * grads["dW" + str(k + 1)]
        parameters["b" + str(k + 1)] = \
            parameters["b" + str(k + 1)] - \
            learning_rate * grads["db" + str(k + 1)]

    return parameters