-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.py
50 lines (40 loc) · 1.32 KB
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# PyTorch has some serious bugs concerning dll loading:
# If PyTorch is loaded before Julia, Julia's import fails.
# We therefore import Julia before anything else
try:
from julia.api import JuliaInfo
info = JuliaInfo.load()
if not info.is_compatible_python():
print('Julia: using non-compiled modules.')
from julia.api import Julia
jl = Julia(compiled_modules=False)
import julia
from julia import Base
except:
# Silent failure, if the program actually
# needs Julia it will re-raise an error
pass
import logging
import click
import commands
@click.group()
def main():
pass
main.add_command(commands.accuracy)
main.add_command(commands.attack)
main.add_command(commands.attack_matrix)
main.add_command(commands.compare)
main.add_command(commands.cross_validation)
main.add_command(commands.distance_dataset)
main.add_command(commands.evasion)
main.add_command(commands.mip)
main.add_command(commands.perfect_approximation)
main.add_command(commands.prune_relu)
main.add_command(commands.prune_weights)
main.add_command(commands.train_approximator)
main.add_command(commands.train_classifier)
main.add_command(commands.tune_mip)
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO,
format='%(name)s:%(levelname)s: %(message)s')
main()