adding test that computes the average sgd