title: Clarification for self.forward function in Python
body: <p>I am not able to understand this <code>sample_losses = self.forward(output, y)</code> defined under the class <code>Loss</code>.</p>
  <p>From which &quot;forward function&quot; it is taking input as forward function is previously defined for all three classes i.e. <code>Dense_layer</code>, <code>Activation_ReLU</code> and <code>Activation_Softmax</code>?</p>
  <pre><code>class Layer_Dense:
      def __init__(self, n_inputs, n_neurons):
          self.weights = 0.01 * np.random.randn(n_inputs, n_neurons)
          self.biases = np.zeros((1, n_neurons))
          print(self.weights)
      def forward(self, inputs):
          self.output = np.dot(inputs, self.weights) + self.biases
  class Activation_ReLU:
      def forward(self, inputs):
          self.output= np.maximum(0, inputs)
  class Activation_Softmax:
      def forward (self, inputs):
          exp_values = np.exp(inputs - np.max(inputs, axis = 1, keepdims= True ))
          probabilities= exp_values/np.sum(exp_values, axis = 1, keepdims= True )
          self.output = probabilities
  class Loss:
      def calculate(self, output, y):
          sample_losses = self.forward(output, y)
          data_loss = np.mean(sample_losses)
          return data_loss
  </code></pre>