コード例 #1
0
    def beta(self):
        self._ensure_is_connected()

        if self._beta is None:
            raise base.Error(
                "Batch normalization doesn't have an offset, so no beta")
        else:
            return self._beta
コード例 #2
0
    def gamma(self):
        self._ensure_is_connected()

        if self._gamma is None:
            raise base.Error(
                "Batch normalization doesn't have a scale, so no gamma")
        else:
            return self._gamma
コード例 #3
0
ファイル: user.py プロジェクト: yanlimin9/critic
 def __eq__(self, other):
     if self.isAnonymous(): return False
     elif isinstance(other, User):
         if other.isAnonymous(): return False
         else: return self.id == other.id
     elif isinstance(other, int):
         return self.id == other
     elif isinstance(other, basestring):
         return self.name == other
     else:
         raise base.Error("invalid comparison")