def update_parameters(parameters, grads, learning_rate=1.2):
    """
    使用梯度更新参数

    Args:
        parameters: 包含所有参数的python字典
        grads: 包含所有参数梯度的python字典
        learning_rate: 学习步长
    Return:
        parameters: 包含更新后参数的python
    """
    # 从"parameters"中读取全部参数
    W1 = parameters["W1"]
    b1 = parameters["b1"]
    W2 = parameters["W2"]
    b2 = parameters["b2"]

    # 从"grads"中读取全部梯度
    dW1 = grads["dW1"]
    db1 = grads["db1"]
    dW2 = grads["dW2"]
    db2 = grads["db2"]

    # 更新参数
    W1 = W1 - learning_rate * dW1
    b1 = b1 - learning_rate * db1
    W2 = W2 - learning_rate * dW2
    b2 = b2 - learning_rate * db2

    parameters = {"W1": W1,
                  "b1": b1,
                  "W2": W2,
                  "b2": b2}

    return parameters