コード例 #1
0
    def denormalize(self, arr):
        """
        denormalize the input

        :param arr: (numpy Number) the normalized input
        :return: (numpy Number) original input
        """
        mean = reshape_for_broadcasting(self.mean, arr)
        std = reshape_for_broadcasting(self.std, arr)
        return mean + arr * std
コード例 #2
0
    def normalize(self, arr, clip_range=None):
        """
        normalize the input

        :param arr: (numpy Number) the input
        :param clip_range: (float) the range to clip to [-clip_range, clip_range]
        :return: (numpy Number) normalized input
        """
        if clip_range is None:
            clip_range = self.default_clip_range
        mean = reshape_for_broadcasting(self.mean, arr)
        std = reshape_for_broadcasting(self.std, arr)
        return tf.clip_by_value((arr - mean) / std, -clip_range, clip_range)
コード例 #3
0
 def denormalize(self, v):
     mean = reshape_for_broadcasting(self.mean, v)
     std = reshape_for_broadcasting(self.std, v)
     return mean + v * std
コード例 #4
0
 def normalize(self, v, clip_range=None):
     if clip_range is None:
         clip_range = self.default_clip_range
     mean = reshape_for_broadcasting(self.mean, v)
     std = reshape_for_broadcasting(self.std, v)
     return tf.clip_by_value((v - mean) / std, -clip_range, clip_range)
コード例 #5
0
ファイル: normalizer.py プロジェクト: Divyankpandey/baselines
 def denormalize(self, v):
     mean = reshape_for_broadcasting(self.mean, v)
     std = reshape_for_broadcasting(self.std,  v)
     return mean + v * std
コード例 #6
0
ファイル: normalizer.py プロジェクト: Divyankpandey/baselines
 def normalize(self, v, clip_range=None):
     if clip_range is None:
         clip_range = self.default_clip_range
     mean = reshape_for_broadcasting(self.mean, v)
     std = reshape_for_broadcasting(self.std,  v)
     return tf.clip_by_value((v - mean) / std, -clip_range, clip_range)