updated generalization test to use a and b from training