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

github.com/torch/optim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaxReimann <max.reimann@student.hpi.uni-potsdam.de>2015-12-21 02:56:10 +0300
committerMaxReimann <max.reimann@student.hpi.uni-potsdam.de>2015-12-21 02:56:10 +0300
commitb3cf7c22441bae6959732acff18f09775226a1fc (patch)
tree1a612085b0eadab9a2aa6ed4d0fe945e6217ee96 /test
parent58db496d7380f8bc73a8d224e427920e40f5c168 (diff)
Adapt cmaes to API, enable n-dimensional tensors as input
Diffstat (limited to 'test')
-rw-r--r--test/test_cmaes.lua17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/test_cmaes.lua b/test/test_cmaes.lua
index 4d21465..6e808d3 100644
--- a/test/test_cmaes.lua
+++ b/test/test_cmaes.lua
@@ -1,10 +1,19 @@
require 'torch'
require 'optim'
-
require 'rosenbrock'
require 'l2'
-x = torch.Tensor(4):fill(0)
-config = {maxEval=10000, sigma=0.5}
-x,fx,i=optim.cmaes(rosenbrock,x, config)
+x = torch.Tensor(2):fill(0)
+config = {maxEval=10000, sigma=0.5, ftarget=0.00001, verb_disp=0}
+x,fx,i=optim.cmaes(rosenbrock,x,config)
+
+
+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()