-
Couldn't load subscription status.
- Fork 20
Open
Description
Could you explain the difference between the binary search in the initialize method [1] and the binary search right after it [2]? It seems to me that the second one is unnecessary, since the image already has been projected to the boundary.
[1] Binary search in the initialize method
Lines 288 to 300 in daecd5c
| # Binary search to minimize l2 distance to original image. | |
| low = 0.0 | |
| high = 1.0 | |
| while high - low > 0.001: | |
| mid = (high + low) / 2.0 | |
| blended = (1 - mid) * sample + mid * random_noise | |
| success = decision_function(model, blended[None], params) | |
| if success: | |
| high = mid | |
| else: | |
| low = mid | |
| initialization = (1 - high) * sample + high * random_noise |
[2] Binary search right after initialize
Lines 81 to 86 in daecd5c
| # Project the initialization to the boundary. | |
| perturbed, dist_post_update = binary_search_batch(sample, | |
| np.expand_dims(perturbed, 0), | |
| model, | |
| params) | |
| dist = compute_distance(perturbed, sample, constraint) |
Metadata
Metadata
Assignees
Labels
No labels