Skip to content

Commit

Permalink
Fix bug where truncated normal was not truncated
Browse files Browse the repository at this point in the history
(cherry picked from commit d54ed18)
  • Loading branch information
dafeda committed Sep 19, 2023
1 parent 3df5ab7 commit 5d4f9a7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ert/config/gen_kw_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ def trans_normal(x: float, arg: List[float]) -> float:
def trans_truncated_normal(x: float, arg: List[float]) -> float:
_mean, _std, _min, _max = arg[0], arg[1], arg[2], arg[3]
y = x * _std + _mean
max(min(y, _max), _min) # clamp
return y
return max(min(y, _max), _min) # clamp

@staticmethod
def trans_lognormal(x: float, arg: List[float]) -> float:
Expand Down

0 comments on commit 5d4f9a7

Please sign in to comment.