Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test_lbfgs_w_ls.lua « test - github.com/torch/optim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cc1eb64b2da9aa0366fc3b537dd4c7b82fda63d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'torch'
require 'optim'

require 'rosenbrock'
require 'l2'

print('--- batch test w/ line search ---')

x = torch.Tensor(2):fill(0)
x,fx,i=optim.lbfgs(rosenbrock,x,{maxIter=100, lineSearch=optim.lswolfe})

print()
print('Rosenbrock test')
print()
print('Number of function evals = ',i)
print('x=');print(x)
print('fx=')
for i=1,#fx do print(i,fx[i]); end
print()
print()