コード例 #1
0
 def compute_loss(self, Y):
     return functions_loss.loss(self.loss, self.get_Afinal(), Y)
コード例 #2
0
 def compute_loss(self, Y):
     Loss = functions_loss.loss(self.loss, self.get_Afinal(), Y)
     for layer in range(self.nlayer):
         Loss += self.info[layer]["lambda"] * np.sum(
             np.square(self.get_param(layer, "param", "W")))
     return Loss