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 the different parameters given in the initialization.
  
  Returned gradients are packed in a single vector so it can be used
  in lbfgs
  
  Parameters
  ----------
  packed_parameters : array-like
      A vector comprising the flattened coefficients and intercepts.
  
  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
  grad : array-like, shape (number of nodes of all layers,)
docstr_tok: ["Compute","the","MLP","loss","function","and","its","corresponding","derivatives","with","respect","to","the","different","parameters","given","in","the","initialization",".","Returned","gradients","are","packed","in","a","single","vector","so","it","can","be","used","in","lbfgs","Parameters","--","--","--","--","--","packed_parameters",":","array-like","A","vector","comprising","the","flattened","coefficients","and","intercepts",".","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","grad",":","array-like",",","shape","(","number","of","nodes","of","all","layers",",",")"]
code: def _loss_grad_lbfgs(
      self,
      packed_coef_inter,
      X,
      y,
      activations,
      deltas,
      coef_grads,
      intercept_grads,
  ):
      """Compute the MLP loss function and its corresponding derivatives
      with respect to the different parameters given in the initialization.
  
      Returned gradients are packed in a single vector so it can be used
      in lbfgs
  
      Parameters
      ----------
      packed_parameters : array-like
          A vector comprising the flattened coefficients and intercepts.
  
      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
      grad : array-like, shape (number of nodes of all layers,)
  
      """
      self._unpack(packed_coef_inter)
      loss, coef_grads, intercept_grads = self._backprop(
          X, y, activations, deltas, coef_grads, intercept_grads
      )
      self.n_iter_ += 1
      grad = _pack(coef_grads, intercept_grads)
      return loss, grad
  
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 5 for calling the BaseMultilayerPerceptron obj's underlying member method code with example usage: obj._loss_grad_lbfgs(packed_coef_inter, X, y, activations, deltas, coef_grads, intercept_grads) and returns: loss,  grad