class_docstr: Class for NOTEARS MLP (Multi-layer Perceptron) model.
  The model weights consist of dag_layer and loc_lin_layer weights respectively.
  dag_layer weight is the weight of the first fully connected layer which determines the causal structure.
  loc_lin_layer weights are the weight of hidden layers after the first fully connected layer
class_docstr_tok: ["Class","for","NOTEARS","MLP","(","Multi-layer","Perceptron",")","model",".","The","model","weights","consist","of","dag_layer","and","loc_lin_layer","weights","respectively",".","dag_layer","weight","is","the","weight","of","the","first","fully","connected","layer","which","determines","the","causal","structure",".","loc_lin_layer","weights","are","the","weight","of","hidden","layers","after","the","first","fully","connected","layer"]
docstr: Performs X_hat reconstruction,
  then converts latent space to original data space via link function.
  
  Args:
      X: input data used to reconstruct
  
  Returns:
      reconstructed data
docstr_tok: ["Performs","X_hat","reconstruction",",","then","converts","latent","space","to","original","data","space","via","link","function",".","Args",":","X",":","input","data","used","to","reconstruct","Returns",":","reconstructed","data"]
code: def reconstruct_data(self, X: np.ndarray) -> np.ndarray:
      """
      Performs X_hat reconstruction,
      then converts latent space to original data space via link function.
  
      Args:
          X: input data used to reconstruct
  
      Returns:
          reconstructed data
      """
  
      # perform preprocessing and column expansions, do NOT refit
      for dist_type in self.dist_types:
          X = dist_type.preprocess_X(X, fit_transform=False)
  
      with torch.no_grad():
          # convert the predict data to pytorch tensor
          X = torch.from_numpy(X).float().to(self.device)
  
          # perform forward reconstruction
          X_hat = self(X)
  
          # recover each one of the latent space projections
          for dist_type in self.dist_types:
              X_hat = dist_type.inverse_link_function(X_hat)
  
          return np.asarray(
              X_hat.cpu().detach().numpy().astype(np.float64)
          )
  
imports: import logging
  from typing import Iterable, List, Tuple, Union
  import numpy
  import scipy.optimize
  import torch
  from sklearn.base import BaseEstimator
  from torch import nn
  from causalnex.structure.pytorch.dist_type._base import DistTypeBase
  from causalnex.structure.pytorch.nonlinear import LocallyConnected
label_desc: Use image node_id 7 for calling the NotearsMLP obj's underlying member method code with example usage: obj.reconstruct_data(X) and returns: np