-
Notifications
You must be signed in to change notification settings - Fork 12
/
eval.py
27 lines (23 loc) · 970 Bytes
/
eval.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
import config
from optparse import OptionParser
from task import Task
from utils import logging_utils
from model_param_space import param_space_dict
import datetime
def parse_args(parser):
parser.add_option("-m", "--model", dest="model_name", type="string")
parser.add_option("-r", "--runs", dest="runs", default=3, type="int")
parser.add_option("-p", "--prefix", dest="prefix", type="string", default="test")
options, args = parser.parse_args()
return options, args
def main(options):
time_str = datetime.datetime.now().isoformat()
logname = "Final_[Model@%s]_%s.log" % (options.model_name, time_str)
logger = logging_utils._get_logger(config.LOG_DIR, logname)
params_dict = param_space_dict[options.model_name]
task = Task(options.model_name, options.runs, params_dict, logger)
task.evaluate(options.prefix)
if __name__ == "__main__":
parser = OptionParser()
options, args = parse_args(parser)
main(options)