support keep_sample_mean=False