diff options
author | karpathy <andrej.karpathy@gmail.com> | 2015-04-16 22:39:42 +0300 |
---|---|---|
committer | karpathy <andrej.karpathy@gmail.com> | 2015-04-16 22:39:42 +0300 |
commit | 695ef7b7765453b2a3056ff87fc9719e23392c40 (patch) | |
tree | 5d44d511c5cd6a3bf24ccac182468ec6526a130f /test | |
parent | 30f6bd3deb8e3b1977dd904a14bac27f7fe71f41 (diff) |
adding rmsprop rosenbrock test, rmsprop converges to 5e-5
Diffstat (limited to 'test')
-rw-r--r-- | test/test_rmsprop.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_rmsprop.lua b/test/test_rmsprop.lua new file mode 100644 index 0000000..069810f --- /dev/null +++ b/test/test_rmsprop.lua @@ -0,0 +1,23 @@ +require 'torch' +require 'optim' + +require 'rosenbrock' +require 'l2' + +x = torch.Tensor(2):fill(0) +fx = {} + +config = {learningRate=5e-4} +for i = 1,10001 do + x,f=optim.rmsprop(rosenbrock,x,config) + if (i-1)%1000 == 0 then + table.insert(fx,f[1]) + end +end + +print() +print('Rosenbrock test') +print() +print('x=');print(x) +print('fx=') +for i=1,#fx do print((i-1)*1000+1,fx[i]); end |