-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathparamUpdate.lua
More file actions
45 lines (42 loc) · 863 Bytes
/
paramUpdate.lua
File metadata and controls
45 lines (42 loc) · 863 Bytes
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
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
function setAug()
local noaug = false
local fName = 'noaug'
if file_exists(fName) then
local f = io.open(fName,'r')
local starg = f:read('*line')
f:close()
os.remove(fName)
if starg == 'true' then
noaug = true
else
noaug = false
end
end
return noaug
end
function setDecay()
local decay = optimState.weightDecay
local fName = 'decay'
if file_exists(fName) then
local f = io.open(fName,'r')
decay = tonumber(f:read('*line'))
f:close()
os.remove(fName)
end
return decay
end
function setRate()
local rate = optimState.learningRate
local fName = 'rate'
if file_exists(fName) then
local f = io.open(fName,'r')
rate = tonumber(f:read('*line'))
f:close()
os.remove(fName)
end
return rate
end