adding if self.average logic
adding test to make sure plain sgd does not have average parameters