-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmain.lua
More file actions
executable file
·47 lines (36 loc) · 770 Bytes
/
Copy pathmain.lua
File metadata and controls
executable file
·47 lines (36 loc) · 770 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
46
47
require 'torch'
require 'cutorch'
require 'paths'
require 'xlua'
require 'optim'
require 'nn'
require 'gnuplot'
torch.setdefaulttensortype('torch.FloatTensor')
local opts = paths.dofile('opts.lua')
opt = opts.parse(arg)
nClasses = opt.nClasses
paths.dofile('util.lua')
requireAll 'layers'
print(opt)
cutorch.setDevice(opt.GPU) -- by default, use GPU 1
torch.manualSeed(opt.manualSeed)
print('Saving everything to: ' .. opt.save)
paths.dofile('data.lua')
paths.dofile('model.lua')
paths.dofile('train.lua')
paths.dofile('test.lua')
paths.dofile('benchmark.lua')
if opt.benchmark then
benchmark()
else
epoch = opt.epochNumber
if opt.testOnly then
test()
else
for i=opt.epochNumber,opt.nEpochs do
train()
test()
epoch = epoch + 1
end
end
end