示例#1
0
文件: nncfg.py 项目: wangqinz/sghmc
 def create_updater( self, w, g_w, sg_w ):
     if self.param.updater == 'sgd':
         return nnupdater.SGDUpdater( w, g_w, self.param )
     elif self.param.updater == 'sghmc' or self.param.updater == 'sgld':
         if self.param.updater == 'sgld':
             self.param.mdecay = 1.0
         return nnupdater.SGHMCUpdater( w, g_w, self.param )
     elif self.param.updater == 'nag':
         return nnupdater.NAGUpdater( w, g_w, self.param )
     else:
         pass
示例#2
0
 def create_updater(self, w, g_w, sg_w):
     if self.param.updater == 'sgd':
         return nnupdater.SGDUpdater(w, g_w, self.param)
     elif self.param.updater == 'sghmc' or self.param.updater == 'sgld':
         if self.param.updater == 'sgld':
             self.param.mdecay = 1.0
         return nnupdater.SGHMCUpdater(w, g_w, self.param)
     elif self.param.updater == 'nag':
         return nnupdater.NAGUpdater(w, g_w, self.param)
     else:
         raise RuntimeError('NNConfig', 'unknown updater')
示例#3
0
 def create_updater(self, w, g_w, sg_w):
     return nnupdater.SGHMCUpdater(w, g_w, self.param)