class_docstr: Base class for MLP classification and regression.
  
  Warning: This class should not be used directly.
  Use derived classes instead.
  
  .. versionadded:: 0.18
docstr: Compute the MLP loss function and its corresponding derivatives
  with respect to each parameter: weights and bias vectors.
  
  Parameters
  ----------
  X : {array-like, sparse matrix}, shape (n_samples, n_features)
      The input data.
  
  y : array-like, shape (n_samples,)
      The target values.
  
  activations: list, length = n_layers - 1
       The ith element of the list holds the values of the ith layer.
  
  deltas : list, length = n_layers - 1
      The ith element of the list holds the difference between the
      activations of the i + 1 layer and the backpropagated error.
      More specifically, deltas are gradients of loss with respect to z
      in each layer, where z = wx + b is the value of a particular layer
      before passing through the activation function
  
  coef_grad : list, length = n_layers - 1
      The ith element contains the amount of change used to update the
      coefficient parameters of the ith layer in an iteration.
  
  intercept_grads : list, length = n_layers - 1
      The ith element contains the amount of change used to update the
      intercept parameters of the ith layer in an iteration.
  
  Returns
  -------
  loss : float
  coef_grads : list, length = n_layers - 1
  intercept_grads : list, length = n_layers - 1
docstr_tok: ["Compute","the","MLP","loss","function","and","its","corresponding","derivatives","with","respect","to","each","parameter",":","weights","and","bias","vectors",".","Parameters","--","--","--","--","--","X",":","{","array-like",",","sparse","matrix","}",",","shape","(","n_samples",",","n_features",")","The","input","data",".","y",":","array-like",",","shape","(","n_samples",",",")","The","target","values",".","activations",":","list",",","length","=","n_layers","-","1","The","ith","element","of","the","list","holds","the","values","of","the","ith","layer",".","deltas",":","list",",","length","=","n_layers","-","1","The","ith","element","of","the","list","holds","the","difference","between","the","activations","of","the","i","+","1","layer","and","the","backpropagated","error",".","More","specifically",",","deltas","are","gradients","of","loss","with","respect","to","z","in","each","layer",",","where","z","=","wx","+","b","is","the","value","of","a","particular","layer","before","passing","through","the","activation","function","coef_grad",":","list",",","length","=","n_layers","-","1","The","ith","element","contains","the","amount","of","change","used","to","update","the","coefficient","parameters","of","the","ith","layer","in","an","iteration",".","intercept_grads",":","list",",","length","=","n_layers","-","1","The","ith","element","contains","the","amount","of","change","used","to","update","the","intercept","parameters","of","the","ith","layer","in","an","iteration",".","Returns","--","--","--","-","loss",":","float","coef_grads",":","list",",","length","=","n_layers","-","1","intercept_grads",":","list",",","length","=","n_layers","-","1"]
code: def _backprop(
      self, X, y, activations, deltas, coef_grads, intercept_grads
  ):
      """Compute the MLP loss function and its corresponding derivatives
      with respect to each parameter: weights and bias vectors.
  
      Parameters
      ----------
      X : {array-like, sparse matrix}, shape (n_samples, n_features)
          The input data.
  
      y : array-like, shape (n_samples,)
          The target values.
  
      activations: list, length = n_layers - 1
           The ith element of the list holds the values of the ith layer.
  
      deltas : list, length = n_layers - 1
          The ith element of the list holds the difference between the
          activations of the i + 1 layer and the backpropagated error.
          More specifically, deltas are gradients of loss with respect to z
          in each layer, where z = wx + b is the value of a particular layer
          before passing through the activation function
  
      coef_grad : list, length = n_layers - 1
          The ith element contains the amount of change used to update the
          coefficient parameters of the ith layer in an iteration.
  
      intercept_grads : list, length = n_layers - 1
          The ith element contains the amount of change used to update the
          intercept parameters of the ith layer in an iteration.
  
      Returns
      -------
      loss : float
      coef_grads : list, length = n_layers - 1
      intercept_grads : list, length = n_layers - 1
      """
      n_samples = X.shape[0]
  
      # Forward propagate
      activations = self._forward_pass(activations)
  
      # Get loss
      loss_func_name = self.loss
      if (
          loss_func_name == "log_loss"
          and self.out_activation_ == "logistic"
      ):
          loss_func_name = "binary_log_loss"
      loss = LOSS_FUNCTIONS[loss_func_name](y, activations[-1])
      # Add L2 regularization term to loss
      values = np.sum(
          np.array([np.dot(s.ravel(), s.ravel()) for s in self.coefs_])
      )
      loss += (0.5 * self.alpha) * values / n_samples
  
      # Backward propagate
      last = self.n_layers_ - 2
  
      # The calculation of delta[last] here works with following
      # combinations of output activation and loss function:
      # sigmoid and binary cross entropy, softmax and categorical cross
      # entropy, and identity with squared loss
      deltas[last] = activations[-1] - y
  
      # Compute gradient for the last layer
      coef_grads, intercept_grads = self._compute_loss_grad(
          last,
          n_samples,
          activations,
          deltas,
          coef_grads,
          intercept_grads,
      )
  
      # Iterate over the hidden layers
      for i in range(self.n_layers_ - 2, 0, -1):
          deltas[i - 1] = safe_sparse_dot(deltas[i], self.coefs_[i].T)
          inplace_derivative = DERIVATIVES[self.activation]
          inplace_derivative(activations[i], deltas[i - 1])
  
          coef_grads, intercept_grads = self._compute_loss_grad(
              i - 1,
              n_samples,
              activations,
              deltas,
              coef_grads,
              intercept_grads,
          )
  
      return loss, coef_grads, intercept_grads
  
imports: import numpy
  from abc import ABCMeta, abstractmethod
  from scipy.optimize import fmin_l_bfgs_b
  import warnings
  from ..base import BaseEstimator, ClassifierMixin, RegressorMixin
  from ._base import ACTIVATIONS, DERIVATIVES, LOSS_FUNCTIONS
  from ._stochastic_optimizers import SGDOptimizer, AdamOptimizer
  from ..model_selection import train_test_split
  from ..externals import six
  from ..preprocessing import LabelBinarizer
  from ..utils import gen_batches, check_random_state
  from ..utils import shuffle
  from ..utils import check_array, check_X_y, column_or_1d
  from ..exceptions import ConvergenceWarning
  from ..utils.extmath import safe_sparse_dot
  from ..utils.validation import check_is_fitted
  from ..utils.multiclass import _check_partial_fit_first_call, unique_labels
  from ..utils.multiclass import type_of_target
label_desc: Use image node_id 6 for calling the BaseMultilayerPerceptron obj's underlying member method code with example usage: obj._backprop(X, y, activations, deltas, coef_grads, intercept_grads) and returns: loss,  coef_grads,  intercept_grads