Skip to content

Commit

Permalink
Merge pull request eth-sri#39 from dimy93/master
Browse files Browse the repository at this point in the history
More fixes for geometric parameters
  • Loading branch information
Gagandeep Singh authored Oct 27, 2020
2 parents 6119890 + c2bb7fc commit e3559ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ will on the fly generate geometric perturbed images and evaluate the network aga


```
python3 . --netname ../nets/pytorch/mnist/convBig__DiffAI.pyt --geometric --data_dir ../deepg/examples/example1/ --num_params 1 --dataset mnist --attack
python3 . --netname ../nets/pytorch/mnist/convBig__DiffAI.pyt --geometric --data_dir ../deepg/code/examples/example1/ --num_params 1 --dataset mnist --attack
```
will evaluate the generated geometric perturbed images in the given data_dir and also evaluate generated attack images.

Expand Down
18 changes: 9 additions & 9 deletions tf_verify/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def init(args):
attack_imgs.append((params, attack_lb, attack_ub))
checked.append(False)

predict_label, _, _, _,_ = eran.analyze_box(
predict_label, _, _, _, _, _ = eran.analyze_box(
attack_lb[:dim], attack_ub[:dim], 'deeppoly',
config.timeout_lp, config.timeout_milp, config.use_default_heuristic)
if predict_label != int(test[0]):
Expand Down Expand Up @@ -809,8 +809,8 @@ def init(args):

normalize(spec_lb, means, stds, config.dataset)
normalize(spec_ub, means, stds, config.dataset)

label, nn, nlb, nub,_ = eran.analyze_box(spec_lb, spec_ub, 'deeppoly', config.timeout_lp, config.timeout_milp,
label, nn, nlb, nub, _, _ = eran.analyze_box(spec_lb, spec_ub, 'deeppoly', config.timeout_lp, config.timeout_milp,
config.use_default_heuristic)
print('Label: ', label)

Expand Down Expand Up @@ -846,9 +846,9 @@ def init(args):
attack_imgs.append((params, attack_lb, attack_ub))
checked.append(False)

predict_label, _, _, _,_ = eran.analyze_box(
predict_label, _, _, _, _, _ = eran.analyze_box(
attack_lb[:dim], attack_ub[:dim], 'deeppoly',
config.timeout_lp, config.timeout_milp, config.use_default_heuristic, 0)
config.timeout_lp, config.timeout_milp, config.use_default_heuristic)
if predict_label != int(test[0]):
print('counter-example, params: ', params, ', predicted label: ', predict_label)
cex_found = True
Expand Down Expand Up @@ -941,15 +941,15 @@ def init(args):
print('Running the analysis...')

t_begin = time.time()
perturbed_label_poly, _, _, _ ,_= eran.analyze_box(
perturbed_label_poly, _, _, _ , _, _ = eran.analyze_box(
spec_lb, spec_ub, 'deeppoly',
config.timeout_lp, config.timeout_milp, config.use_default_heuristic, 0,
config.timeout_lp, config.timeout_milp, config.use_default_heuristic, None,
lexpr_weights, lexpr_cst, lexpr_dim,
uexpr_weights, uexpr_cst, uexpr_dim,
expr_size)
perturbed_label_box, _, _, _,_ = eran.analyze_box(
perturbed_label_box, _, _, _, _, _ = eran.analyze_box(
spec_lb[:dim], spec_ub[:dim], 'deeppoly',
config.timeout_lp, config.timeout_milp, config.use_default_heuristic, 0)
config.timeout_lp, config.timeout_milp, config.use_default_heuristic)
t_end = time.time()

print('DeepG: ', perturbed_label_poly, '\tInterval: ', perturbed_label_box, '\tlabel: ', label,
Expand Down

0 comments on commit e3559ef

Please sign in to comment.