Update weights.