Hi! Thank you for the reply to the question about the 'CROWN' repository!
I want to calculate the minimum r as the same as the 'CROWN', and I tried the code as follows:
def test(input,model):
eps = 0
gap_gx = 100
eps_LB = -1
eps_UB = 1
counter = 0
is_pos = True
is_neg = True
Hi! Thank you for the reply to the question about the 'CROWN' repository! I want to calculate the minimum r as the same as the 'CROWN', and I tried the code as follows: def test(input,model): eps = 0 gap_gx = 100 eps_LB = -1 eps_UB = 1 counter = 0 is_pos = True is_neg = True
perform binary search
eps_gx_UB = 1000000.0 eps_gx_LB = 0.0 is_pos = True is_neg = True
eps = eps_gx_LB*2
eps = args.eps
while eps_gx_UB - eps_gx_LB > 0.00001: ptb = PerturbationLpNorm(norm=2, eps=eps) image = BoundedTensor(input, ptb) pred = model(image) label = torch.argmax(pred, dim=1).cpu().numpy()
for method in ['IBP', 'IBP+backward (CROWN-IBP)', 'backward (CROWN)']:
print("[L2][binary search] step = {}, eps = {:.5f}, gap_gx = {:.2f}".format(counter, eps, gap_gx))
But the result is failed and the lp cannot change with the eps. I'm confused about it. Thank you!