當前位置: 首頁>>代碼示例>>Python>>正文


Python util.reshape_for_broadcasting方法代碼示例

本文整理匯總了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) 
開發者ID:Hwhitetooth,項目名稱:lirpg,代碼行數:8,代碼來源:normalizer.py

示例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 
開發者ID:Hwhitetooth,項目名稱:lirpg,代碼行數:6,代碼來源:normalizer.py


注:本文中的baselines.her.util.reshape_for_broadcasting方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。