def update_parameters(layers, learning_rate):
    """
    Updates the parameters of the layer

    Arguments:
    layers -- The list with the layers along with the coresponding hyperparameters
    learning_rate -- The learning rate by which the model is learning

    Returns:
    layers -- The updated list with the layers along with the oresponding hyperparameters
    """
    num_layer = len(layers)
    for i in range(num_layer):
        mode = layers[i]['mode']
        if mode == 'pool':
            continue
        elif mode == 'fc' or mode == 'conv':
            layers[i]['W'] = layers[i]['W'] - learning_rate * layers[i]['dW']
            layers[i]['b'] = layers[i]['b'] - learning_rate * layers[i]['db']
        else:
            print('Wrong layer mode in [{}]'.format(i))
    return layers
