class_docstr: Implementation of a database reconstruction attack. In this case, the adversary is assumed to have in his/her
  possession a model trained on a dataset, and all but one row of that training dataset. This attack attempts to
  reconstruct the missing row.
class_docstr_tok: ["Implementation","of","a","database","reconstruction","attack",".","In","this","case",",","the","adversary","is","assumed","to","have","in","his\/her","possession","a","model","trained","on","a","dataset",",","and","all","but","one","row","of","that","training","dataset",".","This","attack","attempts","to","reconstruct","the","missing","row","."]
docstr: Infer the missing row from x, y with which `estimator` was trained with.
  
  :param x: Known records of the training set of `estimator`.
  :param y: Known labels of the training set of `estimator`.
docstr_tok: ["Infer","the","missing","row","from","x",",","y","with","which","`","estimator","`","was","trained","with",".",":","param","x",":","Known","records","of","the","training","set","of","`","estimator","`",".",":","param","y",":","Known","labels","of","the","training","set","of","`","estimator","`","."]
code: def reconstruct(
      self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs
  ) -> Tuple[np.ndarray, np.ndarray]:
      """
      Infer the missing row from x, y with which `estimator` was trained with.
  
      :param x: Known records of the training set of `estimator`.
      :param y: Known labels of the training set of `estimator`.
      """
      if y is None:
          y = self.estimator.predict(x=x)
  
      if y.ndim == 2:
          y = np.argmax(y, axis=1)
  
      tol = float("inf")
      x_0 = x[0, :]
      x_guess: Optional[np.ndarray] = None
      y_guess: int
  
      for _y in range(self.estimator.nb_classes):
          args = (
              _y,
              x,
              y,
              self._estimator,
              self.estimator,
              self.params,
          )
          _x, _tol, _ = fmin_l_bfgs_b(
              self.objective,
              x_0,
              args=args,
              approx_grad=True,
              factr=100,
              pgtol=1e-10,
              bounds=None,
          )
  
          if _tol < tol:
              tol = _tol
              x_guess = _x
              y_guess = _y
  
      if x_guess is None:
          raise ValueError("Guessed values are None.")
  
      x_reconstructed = np.expand_dims(x_guess, axis=0)
      y_reconstructed = np.zeros(shape=(1, self.estimator.nb_classes))
      y_reconstructed[0, y_guess] = 1
  
      return x_reconstructed, y_reconstructed
  
file_path: adversarial-robustness-toolbox/art/attacks/inference/reconstruction/white_box.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple
  import numpy
  import sklearn
  from scipy.optimize import fmin_l_bfgs_b
  from art.attacks.attack import ReconstructionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
  from art.estimators.classification.scikitlearn import ScikitlearnEstimator
label_desc: Use image node_id 3 for calling the DatabaseReconstruction obj's underlying member method code with example usage: obj.reconstruct(x, y) and returns: x_reconstructed,  y_reconstructed