neural_network.py
def calculate_loss(self):
        """ Evaluate loss function in the model """
        probs = self.__forward_prop__(self.X)
        # Calculating the loss
        corect_logprobs = -np.log(probs[range(self.num_examples), self.Y])
        data_loss = np.sum(corect_logprobs)
        # Todo: add regulatization term to loss
        return 1. / self.num_examples * data_loss
 Evaluate loss function in the model 
Evaluate loss function in the model
Evaluate loss function in the model
def calculate_loss(self):
        probs = self.__forward_prop__(self.X)
        corect_logprobs = -np.log(probs[range(self.num_examples), self.Y])
        data_loss = np.sum(corect_logprobs)
        return 1. / self.num_examples * data_loss
def calculate_loss ( self ) : probs = self . __forward_prop__ ( self . X ) corect_logprobs = - np . log ( probs [ range ( self . num_examples ) , self . Y ] ) data_loss = np . sum ( corect_logprobs ) return 1. / self . num_examples * data_loss
Evaluate loss function in the model
Evaluate loss function in the model
""" Evaluate loss function in the model """ # Calculating the loss # Todo: add regulatization term to loss
self