예제 #1
0
 def shared(self, init, name, role=PARAMETER, **kwargs):
     p = self.params.get(name)
     if p is None:
         p = shared_param(init, name, role, **kwargs)
         self.params[name] = p
     else:
         assert p.get_value().shape == np.shape(init)
     return p
예제 #2
0
파일: tagger.py 프로젝트: CuriousAI/tagger
 def shared(self, init, name, role=PARAMETER, **kwargs):
     p = self.params.get(name)
     if p is None:
         p = shared_param(init, name, role, **kwargs)
         self.params[name] = p
     else:
         assert p.get_value().shape == np.shape(init)
     return p
예제 #3
0
파일: ladder.py 프로젝트: fulldecent/LRE
 def shared(self, init, name, cast_float32=True, role=PARAMETER, **kwargs):
     p = self.shareds.get(name)
     if p is None:
         p = shared_param(init, name, cast_float32, role, **kwargs)
         self.shareds[name] = p
     return p
예제 #4
0
 def shared(self, init, name, cast_float32=True, role=PARAMETER, **kwargs):
     p = self.shareds.get(name)
     if p is None:
         p = shared_param(init, name, cast_float32, role, **kwargs)
         self.shareds[name] = p
     return p