本文整理匯總了Python中baselines.her.util.reshape_for_broadcasting方法的典型用法代碼示例。如果您正苦於以下問題:Python util.reshape_for_broadcasting方法的具體用法?Python util.reshape_for_broadcasting怎麽用?Python util.reshape_for_broadcasting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類baselines.her.util
的用法示例。
在下文中一共展示了util.reshape_for_broadcasting方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: normalize
# 需要導入模塊: from baselines.her import util [as 別名]
# 或者: from baselines.her.util import reshape_for_broadcasting [as 別名]
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)
示例2: denormalize
# 需要導入模塊: from baselines.her import util [as 別名]
# 或者: from baselines.her.util import reshape_for_broadcasting [as 別名]
def denormalize(self, v):
mean = reshape_for_broadcasting(self.mean, v)
std = reshape_for_broadcasting(self.std, v)
return mean + v * std