update_weights function

Updating the weights of base models