Commit 47defa1
Enforce equality constraints in random generator rejection sampling (#5182)
Summary:
Pull Request resolved: #5182
Random generators (Sobol, etc.) were not respecting equality constraints
during candidate generation. Two fixes:
1. When equality constraints are present, skip rejection sampling entirely
and go straight to polytope sampling. Unconstrained random samples have
probability zero of satisfying continuous equality constraints, so
rejection sampling would always exhaust max_draws.
2. Add `equality_constraints` parameter to `rejection_sample` and
`check_param_constraints` so that post-rounding feasibility checks
also validate equality constraints (important when the polytope sampler
fallback uses rejection_sample for deduplication).
Reviewed By: esantorella
Differential Revision: D100256485
fbshipit-source-id: 540e45ad2fd4852ecff7dc7500930758d4fed9791 parent cd36879 commit 47defa1
2 files changed
Lines changed: 62 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
| |||
184 | 191 | | |
185 | 192 | | |
186 | 193 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
| |||
229 | 240 | | |
230 | 241 | | |
231 | 242 | | |
| 243 | + | |
232 | 244 | | |
233 | 245 | | |
234 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
| |||
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
127 | 134 | | |
128 | 135 | | |
129 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
130 | 151 | | |
131 | 152 | | |
132 | 153 | | |
| |||
140 | 161 | | |
141 | 162 | | |
142 | 163 | | |
143 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
144 | 169 | | |
145 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
146 | 173 | | |
147 | 174 | | |
148 | 175 | | |
| |||
228 | 255 | | |
229 | 256 | | |
230 | 257 | | |
| 258 | + | |
231 | 259 | | |
232 | 260 | | |
233 | 261 | | |
| |||
236 | 264 | | |
237 | 265 | | |
238 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
239 | 270 | | |
240 | 271 | | |
241 | 272 | | |
| |||
246 | 277 | | |
247 | 278 | | |
248 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
249 | 291 | | |
250 | 292 | | |
251 | 293 | | |
| |||
0 commit comments