Normalize gradient by number of samples.