示例#1
0
 def init_regularization(self):
     l1 = 0
     l2 = 0
     for w in self.weights:
         l1 += T.sum(abs(w))
         l2 += T.sum(w ** 2)
     # l2 = T.sqrt(l2)
     return l1, l2
示例#2
0
 def init_regularization(self):
     l1 = 0
     l2 = 0
     for layer in self.weighted_layers:
         w = layer.w
         l1 += T.sum(abs(w))
         l2 += T.sum(w**2)
     # l2 = T.sqrt(l2)
     return l1, l2
示例#3
0
 def init_regularization(self):
     l1 = 0
     l2 = 0
     for layer in self.weighted_layers:
         w = layer.w
         l1 += T.sum(abs(w))
         l2 += T.sum(w ** 2)
     # l2 = T.sqrt(l2)
     return l1, l2