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:
authorAlfredo Canziani <alfredo.canziani@gmail.com>2016-08-08 18:23:28 +0300
committerGitHub <noreply@github.com>2016-08-08 18:23:28 +0300
commita4b745e95e88e9b741d25f8a82a6fb4742113a7f (patch)
treeb6fc8f4cdb8060488a32a886f5bf697e71fb2390
parent540354b84b1f71f65a9dd9fe3e2093979b627c5e (diff)
One-line Logger initialisation
A `Logger` can be created and setup in one line log = optim.logger('foo'):setNames{'a', 'b'}:style{'-', '-'}
-rw-r--r--Logger.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/Logger.lua b/Logger.lua
index 02421b9..48915ef 100644
--- a/Logger.lua
+++ b/Logger.lua
@@ -76,6 +76,7 @@ function Logger:setNames(names)
end
self.file:write('\n')
self.file:flush()
+ return self
end
function Logger:add(symbols)
@@ -120,6 +121,7 @@ function Logger:style(symbols)
xlua.error('style should be a string or a table of strings','Logger')
end
end
+ return self
end
function Logger:setlogscale(value)