165a86f1ab91c86828e55b3ca62030569e1c2c61,rllib/models/torch/torch_action_dist.py,TorchSquashedGaussian,_squash,#TorchSquashedGaussian#Any#,215
Before Change
// Make sure raw_values are not too high/low (such that tanh would
// return exactly 1.0/-1.0, which would lead to +/-inf log-probs).
return (torch.clamp(
torch.tanh(raw_values) ,
-1.0 + SMALL_NUMBER,
1.0 - SMALL_NUMBER) + 1.0) / 2.0 * (self.high - self.low) + \
self.low
After Change
def _squash(self, raw_values):
// Returned values are within [low, high] (including `low` and `high`).
squashed = ((torch.tanh(raw_values) + 1.0) / 2.0) * \
(self.high - self.low) + self.low
return torch.clamp(squashed, self.low, self.high)
def _unsquash(self, values):
normed_values = (values - self.low) / (self.high - self.low) * 2.0 - \
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances Project Name: ray-project/ray
Commit Name: 165a86f1ab91c86828e55b3ca62030569e1c2c61
Time: 2020-04-19
Author: sven@anyscale.io
File Name: rllib/models/torch/torch_action_dist.py
Class Name: TorchSquashedGaussian
Method Name: _squash
Project Name: maciejkula/spotlight
Commit Name: 2767c948afa434f863df3b5eb1946a032dfba588
Time: 2017-07-13
Author: maciej.kula@gmail.com
File Name: spotlight/sequence/representations.py
Class Name: CNNNet
Method Name: user_representation
Project Name: ray-project/ray
Commit Name: 165a86f1ab91c86828e55b3ca62030569e1c2c61
Time: 2020-04-19
Author: sven@anyscale.io
File Name: rllib/models/tf/tf_action_dist.py
Class Name: SquashedGaussian
Method Name: _squash
Project Name: OpenNMT/OpenNMT-py
Commit Name: 7bc571a99fdee0e322c16fd725a8c87a4addf9fd
Time: 2017-07-05
Author: s.gehrmann@outlook.com
File Name: onmt/modules/GlobalAttention.py
Class Name: GlobalAttention
Method Name: forward