Skip to content

Commit

Permalink
some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sally-xu-42 committed Nov 20, 2022
1 parent 77841f4 commit 97e4813
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions code/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@

class DeepPoly:
def __init__(self, lb, ub, lexpr, uexpr) -> None:
"""
Arguments
---------
lb : concrete lower bound
ub: concrete upper bound
lexpr: symbolic lower bound
uexpr: symbolic upper bound
"""
self.lb = lb
self.ub = ub
self.lexpr = lexpr
self.uexpr = uexpr
# TODO: remove asserts to improve speed
assert not torch.isnan(self.lb).any()
assert not torch.isnan(self.ub).any()
assert lexpr is None or (
Expand All @@ -25,6 +34,7 @@ def __init__(self, lb, ub, lexpr, uexpr) -> None:
(not torch.isnan(self.uexpr[0]).any())
and (not torch.isnan(self.uexpr[1]).any())
)
# TODO: what is dim here
self.dim = lb.size()[0]

@staticmethod
Expand Down Expand Up @@ -166,6 +176,8 @@ def analyze(net, inputs: torch.Tensor, eps: torch.float32, true_label: int):
print(net.layers)
print(eps)
print(inputs.shape)

pixel_values = inputs.flatten()

return 0

Expand Down

0 comments on commit 97e4813

Please sign in to comment.