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:
authorGregory Essertel <gregory.essertel@gmail.com>2014-06-02 20:05:09 +0400
committerGregory Essertel <gregory.essertel@gmail.com>2014-06-02 20:05:09 +0400
commit7f85b3747fc38f980b1df42553d52b819ad6aea0 (patch)
treeb4175aa0aba837ce923f35ff5e87f1d69c69db56 /test
parent4ebb76ebaa26c1974313382beb57298b5b7f40e1 (diff)
Added test for logger
Diffstat (limited to 'test')
-rw-r--r--test/test_logger.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_logger.lua b/test/test_logger.lua
new file mode 100644
index 0000000..6ee8cc4
--- /dev/null
+++ b/test/test_logger.lua
@@ -0,0 +1,20 @@
+require 'optim'
+
+
+logger_former = optim.Logger('accuracy-former.log')
+logger_new = optim.Logger('accuracy-new.log')
+
+logger_new:setNames({'channel 1', 'channel 2', 'channel 3'})
+
+for i = 1, 20 do
+ logger_former:add({['channel 1'] = 1 , ['channel 2'] = 0.1 * i, ['channel 3'] = 1 - 0.2 * i})
+ logger_new:add({1 , 0.1 * i, 1 - 0.2 * i})
+end
+
+logger_former:style({['channel 1'] = '-' , ['channel 2'] = '-', ['channel 3'] = '-'})
+logger_new:style{'-', '-', '-'}
+
+logger_former:plot()
+logger_new:plot()
+
+