示例#1
0
文件: nncfg.py 项目: wangqinz/sghmc
 def create_hyperupdater( self, updaterlist ):
     if self.param.hyperupdater == 'none':
         return []
     elif self.param.hyperupdater == 'gibbs-joint':
         return [ nnupdater.HyperUpdater( self.param, updaterlist ) ]
     elif self.param.hyperupdater == 'gibbs-sep':
         return [ nnupdater.HyperUpdater( self.param, [u] ) for u in updaterlist ]
     else:
         pass
示例#2
0
 def create_hyperupdater(self, updaterlist):
     if self.param.hyperupdater == 'none':
         return []
     elif self.param.hyperupdater == 'gibbs-joint':
         return [nnupdater.HyperUpdater(self.param, updaterlist)]
     elif self.param.hyperupdater == 'gibbs-sep':
         return [
             nnupdater.HyperUpdater(self.param, [u]) for u in updaterlist
         ]
     else:
         raise RuntimeError('NNConfig', 'unknown hyperupdater')
示例#3
0
 def create_hyperupdater(self, updaterlist):
     if self.param.hyperupdater == 'none':
         return []
     elif self.param.hyperupdater == 'gibbs-joint':
         return [nnupdater.HyperUpdater(self.param, updaterlist)]
     elif self.param.hyperupdater == 'gibbs-sep':
         # Default case: create HyperUpdater for _each_ weight. It's what I
         # have in my blog post; each weight gets its own sampled h-params.
         return [
             nnupdater.HyperUpdater(self.param, [u]) for u in updaterlist
         ]
     else:
         raise Exception('NNConfig', 'unknown hyperupdater')
示例#4
0
 def create_hyperupdater(self, updaterlist):
     return [nnupdater.HyperUpdater(self.param, [u]) for u in updaterlist]