-
Notifications
You must be signed in to change notification settings - Fork 0
/
opts.lua
35 lines (30 loc) · 1.45 KB
/
opts.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
26
27
28
29
30
31
32
33
34
35
local M = {}
function M.parse(arg)
local cmd = torch.CmdLine();
cmd:text()
cmd:text('The German Traffic Sign Recognition Benchmark: A multi-class classification ')
cmd:text()
cmd:text('Options:')
cmd:option('-data', '', 'Path to dataset')
cmd:option('-val', 10, 'Percentage to use for validation set')
cmd:option('-nEpochs', 30, 'Maximum epochs')
cmd:option('-batchsize', 128, 'Batch size for epochs')
cmd:option('-nThreads', 1, 'Number of dataloading threads')
cmd:option('-manualSeed', '0', 'Manual seed for RNG')
cmd:option('-LR', 0.1, 'initial learning rate')
cmd:option('-momentum', 0.9, 'momentum')
cmd:option('-weightDecay', 1e-4, 'weight decay')
cmd:option('-logDir', 'logs', 'log directory')
cmd:option('-model', '', 'Model to use for training')
cmd:option('-verbose', 'false', 'Print stats for every batch')
--[[
-- Hint: Use this option to convert your code to use GPUs
--]]
-- cmd:option('-cuda', '', 'Use cuda tensor')
local opt = cmd:parse(arg or {})
if opt.model == '' or not paths.filep('models/'..opt.model..'.lua') then
cmd:error('Invalid model ' .. opt.model)
end
return opt
end
return M