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

Trainer.lua - github.com/clementfarabet/lua---nnx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 34d1d33dc21064219e60dd29527c92bb23c86e0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local Trainer = torch.class('nn.Trainer')

function Trainer:__init()
   self.learningRate = 0.01
   self.learningRateDecay = 0
   self.maxIteration = 25
end

function Trainer:train(dataset)
end

function Trainer:share(mlp, ...)
   for i,v in ipairs(arg) do
      if self[v] ~=nil then self[v]:set(mlp[v]) end
   end
end

function Trainer:clone(...)
   local f = torch.MemoryFile("rw"):binary()
   f:writeObject(self)
   f:seek(1)
   local clone = f:readObject()
   f:close()
   if select('#',...) > 0 then
      clone:share(self,...)
   end
   return clone
end