Add function to learn optimal alpha weights