forked from bouthilx/ift6266kaggle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_main.py
36 lines (27 loc) · 1.15 KB
/
local_main.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
from pylearn2.utils.shell import run_shell_command
from pylearn2.utils import serial
from gen_yaml import generate_params, write_files
import contest_dataset
import sys
import os
DIR = "/home/xavier/ift6266kaggle/conv/exp3/"
OUT = DIR+"yaml/test.yaml"
TEMPLATE = DIR+"template.yaml"
HPARAMS = DIR+"hparams.conf"
if __name__ == "__main__":
# Generates a list of hyper-parameter names and a list of
# hyper-parameter values
hpnames, hpvalues = generate_params(hparamfile=HPARAMS,
generate="uniform",
search_mode="fix-grid-search")
force = len(sys.argv)>1 and sys.argv[1]=="--force"
# Writes template with each hyper-parameter settings in
# succesive files and returns the name of the files
files = write_files(template="".join(open(TEMPLATE,"r")),hpnames=hpnames,
hpvalues=hpvalues,save_path=OUT,force=force)
for f in files:
serial.load_train_file(f).main_loop()
# for i in range(46-24):
# f = DIR+"yaml/second%d.yaml" % (i+24)
# print i+24,"on",46,"done"
# serial.load_train_file(f).main_loop()