예제 #1
0
파일: __main__.py 프로젝트: z971586668/eran
is_trained_with_pytorch = file_extension == ".pyt"
is_saved_tf_model = file_extension == ".meta"
is_pb_file = file_extension == ".pb"
is_tensorflow = file_extension == ".tf"
is_onnx = file_extension == ".onnx"
assert is_trained_with_pytorch or is_saved_tf_model or is_pb_file or is_tensorflow or is_onnx, "file extension not supported"

epsilon = config.epsilon
assert (epsilon >= 0) and (epsilon <= 1), "epsilon can only be between 0 and 1"

zonotope_file = config.zonotope
zonotope = None
zonotope_bool = (zonotope_file != None)
if zonotope_bool:
    zonotope = read_zonotope(zonotope_file)

domain = config.domain

if zonotope_bool:
    assert domain in ['deepzono', 'refinezono'
                      ], "domain name can be either deepzono or refinezono"
elif not config.geometric:
    assert domain in [
        'deepzono', 'refinezono', 'deeppoly', 'refinepoly'
    ], "domain name can be either deepzono, refinezono, deeppoly or refinepoly"

dataset = config.dataset

if zonotope_bool == False:
    assert dataset in [
예제 #2
0
is_saved_tf_model = False

if(file_extension==".pyt"):
    is_trained_with_pytorch = True
elif(file_extension==".meta"):
    is_saved_tf_model = True
elif(file_extension!= ".tf"):
    print("file extension not supported")
    exit(1)

epsilon = args.epsilon
assert (epsilon >= 0) and (epsilon <= 1), "epsilon can only be between 0 and 1"

zonotope_bool = args.zonotope
if zonotope_bool:
    zonotope = read_zonotope(filename + ZONOTOPE_EXTENSION)

domain = args.domain

assert domain in ['deepzono', 'refinezono', 'deeppoly', 'refinepoly'], "domain name can be either deepzono, refinezono, deeppoly or refinepoly"

dataset = args.dataset
if((dataset!='mnist') and (dataset!='cifar10') and (dataset!='acasxu')):
    print("only mnist, cifar10, and acasxu datasets are supported")
    exit(1)


specnumber = 9
if(dataset=='acasxu' and (specnumber!=9)):
    print("currently we only support property 9 for acasxu")
    exit(1)