-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.lua
More file actions
41 lines (31 loc) · 739 Bytes
/
test.lua
File metadata and controls
41 lines (31 loc) · 739 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
require 'optim'
require 'seboost_parallel_simulation'
require 'torch'
require 'image'
require 'nn'
require 'cunn'
require 'cudnn'
trainData = torch.randn(1000)
trainLabels = torch.randn(1000)
optimState = {}
sesopConfig = {
--optMethod=optim.adadelta,
optMethod=optim.adagrad,
histSize=10,
sesopData=trainData,
sesopLabels=trainLabels,
isCuda=true,
optConfig={}, --state for the inner optimization function. We need one for each solver!!
sesopUpdate=400, --sesop iteration every 400 'optMethod' iterations.
sesopBatchSize=100,
nodeIters=2
}
function feval(x, inputs, targets)
return x*x, 2*x
end
x = torch.randn(1)
x[1] = 1
x = x:cuda()
for i=1,6 do
optim.seboost(feval, x, sesopConfig, optimState)
end