def compute_dataset_moments(self):
        # store states so we can use get_batch w/o addn actions
        tf = self.tf
        rng_aug_params = self.rng_aug_params
        batch_zmuv = self.batch_zmuv
        sample_zmuv = self.sample_zmuv

        self.tf = None
        self.rng_aug_params = None
        self.batch_zmuv = False
        self.sample_zmuv = False

        # compute mean/std in batches
        batches_mean = []
        batches_std = []
        for ret in self.get_batch(batch_size=self.dataset_zmuv_bsize):
            if self.y is None:
                mb_x = ret
            else:
                mb_x = ret[0]

            mean = mb_x.mean(axis=self.dataset_axis)
            std = (mb_x - mean).std(axis=self.dataset_axis)

            batches_mean.append(mean)
            batches_std.append(std)

        # reset state
        self.tf = tf
        self.rng_aug_params = rng_aug_params
        self.batch_zmuv = batch_zmuv
        self.sample_zmuv = sample_zmuv

        return (np.mean(batches_mean, axis=0), np.mean(batches_std, axis=0))
Compute mean and std of entire dataset by taking the average
dataset/ETHPy150Open longubu/datumio/datumio/datagen.py/DataGenerator.compute_dataset_moments