-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsearch_specialist.lua
26 lines (25 loc) · 1.11 KB
/
search_specialist.lua
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
local log_file = io.open('search_specialistlog.log','w')
best_val = torch.FloatTensor(9):fill(0)
for i=1,18 do
for j=1,9 do
hard_strength = 1*10^(torch.uniform(-4,-1))
alpha = 1 - hard_strength
lr = 1*10^(torch.uniform(0,2) - 3) / hard_strength
Temp = 1*10^(torch.uniform(0,1.5))
str = 'th train_specialists.lua -T '.. Temp..' -learningRate '..lr..' -alpha ' .. alpha ..
' -max_epoch 130 -epoch_step 30 -checkpoint 130 -pretrained true' ..
' -m \' trying massive search\' -index ' .. j
os.execute(str)
val_running_mean = torch.load('specialist_logs/running_val.t7')
if val_running_mean > best_val[j] then
print('found best for spec ' .. j .. ' at val: ' .. val_running_mean)
best_val[j] = val_running_mean
log_file:write('best with: ' .. val_running_mean .. ' ' .. str .. '\n')
os.execute('cp specialist_logs/sp' ..j.. 'ep130.net specialist_logs/best_spec_' ..j.. '.net')
os.execute('cp specialist_logs/report' ..j.. '.html specialist_logs/best_report' ..j.. '.html')
else
log_file:write(str .. '\n')
end
end
end
log_file:close()