浏览代码

Add clipping to Torch

/develop/torch-clip-scale
Ervin Teng 4 年前
当前提交
f00ff21d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      ml-agents/mlagents/trainers/torch/distributions.py

2
ml-agents/mlagents/trainers/torch/distributions.py


def sample(self):
sample = self.mean + torch.randn_like(self.mean) * self.std
return sample
return torch.clamp(sample, -3, 3) / 3
def log_prob(self, value):
var = self.std ** 2

正在加载...
取消
保存