def get_weights(model):
    """
    Return weights of Keras model as a list of tuples (w, b), where w is a numpy array of weights and b is a numpy array
    of biases for a layer. The order of the list is the same as the layers in the model.
    :param model: Keras model
    :return: List of layer weights (w, b)
    """
    weights = model.get_weights()
    assert len(weights) % 2 == 0
    return list(zip(weights[0::2], weights[1::2]))