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
diff options
context:
space:
mode:
authorkoray kavukcuoglu <koray@kavukcuoglu.org>2015-07-30 20:28:37 +0300
committerkoray kavukcuoglu <koray@kavukcuoglu.org>2015-07-30 20:28:37 +0300
commite5da24d3b011eb8ee6a8f003a6d844f75947ec36 (patch)
tree221171312fa86a8465bc0766ecd94199b7b3becf
parent5035f46f7337a3eb1624d29ac6b3f1c717abb5fc (diff)
parentaf47854f2127744d4a8b83b2c0d601f63bea468c (diff)
Merge pull request #62 from mys007/loggerex
New features in Logger
-rw-r--r--Logger.lua19
1 files changed, 13 insertions, 6 deletions
diff --git a/Logger.lua b/Logger.lua
index 814a632..91b93e5 100644
--- a/Logger.lua
+++ b/Logger.lua
@@ -53,6 +53,9 @@ function Logger:__init(filename, timestamp)
self.names = {}
self.idx = {}
self.figure = nil
+ self.showPlot = true
+ self.plotRawCmd = nil
+ self.defaultStyle = '+'
end
function Logger:setNames(names)
@@ -62,7 +65,7 @@ function Logger:setNames(names)
for k,key in pairs(names) do
self.file:write(key .. '\t')
self.symbols[k] = {}
- self.styles[k] = {'+'}
+ self.styles[k] = {self.defaultStyle}
self.idx[key] = k
end
self.file:write('\n')
@@ -77,7 +80,7 @@ function Logger:add(symbols)
for k,val in pairs(symbols) do
self.file:write(k .. '\t')
self.symbols[k] = {}
- self.styles[k] = {'+'}
+ self.styles[k] = {self.defaultStyle}
self.names[k] = k
end
self.idx = self.names
@@ -148,14 +151,18 @@ function Logger:plot(...)
end
end
if plotit then
- self.figure = gnuplot.figure(self.figure)
- gnuplot.plot(plots)
- gnuplot.grid('on')
- gnuplot.title('<Logger::' .. self.name .. '>')
+ if self.showPlot then
+ self.figure = gnuplot.figure(self.figure)
+ gnuplot.plot(plots)
+ if self.plotRawCmd then gnuplot.raw(self.plotRawCmd) end
+ gnuplot.grid('on')
+ gnuplot.title('<Logger::' .. self.name .. '>')
+ end
if self.epsfile then
os.execute('rm -f "' .. self.epsfile .. '"')
local epsfig = gnuplot.epsfigure(self.epsfile)
gnuplot.plot(plots)
+ if self.plotRawCmd then gnuplot.raw(self.plotRawCmd) end
gnuplot.grid('on')
gnuplot.title('<Logger::' .. self.name .. '>')
gnuplot.plotflush()