Commit e618743
Avoid division by zero in normalize & unnormalize when lower & upper bounds are equal (#2363)
Summary:
Pull Request resolved: #2363
When lower and upper bounds are equal for a dimension, set `upper = lower + 1` to avoid division by zero in `normalize`. The behavior is mirrored in `unnormalize` to preserve `X = unnormalize(normalize(X, bounds), bounds)`.
This fixes some downstream issues observed in `get_chebyshev_objective`, and also lets us simplify `bounds` computation there.
Reviewed By: sdaulton
Differential Revision: D58168827
fbshipit-source-id: 37f29876fdab653c426a04b7c4a4122c8d41e4971 parent 91b45b7 commit e618743
File tree
4 files changed
+53
-9
lines changed- botorch/utils
- multi_objective
- test/utils
- multi_objective
4 files changed
+53
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 98 | + | |
| 99 | + | |
106 | 100 | | |
107 | 101 | | |
108 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
49 | 68 | | |
50 | 69 | | |
51 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
52 | 75 | | |
53 | 76 | | |
54 | 77 | | |
| |||
65 | 88 | | |
66 | 89 | | |
67 | 90 | | |
| 91 | + | |
68 | 92 | | |
69 | 93 | | |
70 | 94 | | |
71 | 95 | | |
72 | 96 | | |
73 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
74 | 102 | | |
75 | 103 | | |
76 | 104 | | |
| |||
87 | 115 | | |
88 | 116 | | |
89 | 117 | | |
| 118 | + | |
90 | 119 | | |
91 | 120 | | |
92 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
| |||
0 commit comments