Update learning alogrithm.