class_docstr: Multilayer Perceptron classifier. A fully-connected neural network with one hidden layer.
  Unrolled to display the whole forward and backward pass.
  
  Parameters:
  -----------
  n_hidden: int:
      The number of processing nodes (neurons) in the hidden layer. 
  n_iterations: float
      The number of training iterations the algorithm will tune the weights for.
  learning_rate: float
      The step length that will be used when updating the weights.
class_docstr_tok: ["Multilayer","Perceptron","classifier",".","A","fully-connected","neural","network","with","one","hidden","layer",".","Unrolled","to","display","the","whole","forward","and","backward","pass",".","Parameters",":","--","--","--","--","--","-","n_hidden",":","int",":","The","number","of","processing","nodes","(","neurons",")","in","the","hidden","layer",".","n_iterations",":","float","The","number","of","training","iterations","the","algorithm","will","tune","the","weights","for",".","learning_rate",":","float","The","step","length","that","will","be","used","when","updating","the","weights","."]
code: def fit(self, X, y):
      self._initialize_weights(X, y)
  
      for i in range(self.n_iterations):
          # ..............
          #  Forward Pass
          # ..............
  
          # HIDDEN LAYER
          hidden_input = X.dot(self.W) + self.w0
          hidden_output = self.hidden_activation(hidden_input)
          # OUTPUT LAYER
          output_layer_input = hidden_output.dot(self.V) + self.v0
          y_pred = self.output_activation(output_layer_input)
  
          # ...............
          #  Backward Pass
          # ...............
  
          # OUTPUT LAYER
          # Grad. w.r.t input of output layer
          grad_wrt_out_l_input = self.loss.gradient(
              y, y_pred
          ) * self.output_activation.gradient(output_layer_input)
          grad_v = hidden_output.T.dot(grad_wrt_out_l_input)
          grad_v0 = np.sum(grad_wrt_out_l_input, axis=0, keepdims=True)
          # HIDDEN LAYER
          # Grad. w.r.t input of hidden layer
          grad_wrt_hidden_l_input = grad_wrt_out_l_input.dot(
              self.V.T
          ) * self.hidden_activation.gradient(hidden_input)
          grad_w = X.T.dot(grad_wrt_hidden_l_input)
          grad_w0 = np.sum(
              grad_wrt_hidden_l_input, axis=0, keepdims=True
          )
  
          # Update weights (by gradient descent)
          # Move against the gradient to minimize loss
          self.V -= self.learning_rate * grad_v
          self.v0 -= self.learning_rate * grad_v0
          self.W -= self.learning_rate * grad_w
          self.w0 -= self.learning_rate * grad_w0
  
file_path: ML-From-Scratch/mlfromscratch/supervised_learning/multilayer_perceptron.py
imports: from __future__ import print_function, division
  import numpy
  import math
  from sklearn import datasets
  from mlfromscratch.utils import train_test_split, to_categorical, normalize, accuracy_score, Plot
  from mlfromscratch.deep_learning.activation_functions import Sigmoid, Softmax
  from mlfromscratch.deep_learning.loss_functions import CrossEntropy
label_desc: Use image node_id 3 for calling the MultilayerPerceptron obj's underlying member method code with example usage: obj.fit(X, y) without return types