class_docstr: This class is used to initialize and run Differentiable Quantum Chemistry (i.e,
  DFT) calculations, using an exchange correlation functional that has been replaced
  by a neural network. This model is based on the paper "Learning the exchange-correlation
  functional from nature with fully differentiable density functional
  theory." and is listed below for reference.
  
  To read more about Density Functional Theory and the exchange
  correlation functional please check the references below.
  
  Examples
  --------
  >>> from deepchem.models.dft.dftxc import XCModel
  >>> from deepchem.data.data_loader import DFTYamlLoader
  >>> inputs = 'deepchem/models/tests/assets/test_dftxcdata.yaml'
  >>> data = DFTYamlLoader()
  >>> dataset = data.create_dataset(inputs)
  >>> dataset.get_shape()
  ((2,), (2,), (2,), (2,))
  >>> model = XCModel("lda_x", batch_size=1)
  >>> loss = model.fit(dataset, nb_epoch=1, checkpoint_interval=1)
  The 6-311++G(3df,3pd) basis for atomz 3 does not exist, but we will download it
  Downloaded to /usr/share/miniconda3/envs/deepchem/lib/python3.8/site-packages/dqc/api/.database/6-311ppg_3df_3pd_/03.gaussian94
  
  Notes
  -----
  There are 4 types of DFT data object implementations that are used to determine the type
  of calculation to be carried out on the entry object. These types are: "ae", "ie", "dm",    "dens", that stand for atomization energy, ionization energy, density matrix and
  density profile respectively.
  The entry type "Density Matrix" cannot be used on model.evaluate as of now.
  To run predictions on this data type, a dataset containing only "dm" entries must
  be used.
  
  References
  ----------
  https://github.com/deepchem/deepchem/blob/3f06168a6c9c16fd90cde7f5246b94f484ea3890/deepchem/models/dft/nnxc.py
  Encyclopedia of Condensed Matter Physics, 2005.
  Kasim, Muhammad F., and Sam M. Vinko. "Learning the exchange-correlation
  functional from nature with fully differentiable density functional
  theory." Physical Review Letters 127.12 (2021): 126403.
class_docstr_tok: ["This","class","is","used","to","initialize","and","run","Differentiable","Quantum","Chemistry","(","i.e",",","DFT",")","calculations",",","using","an","exchange","correlation","functional","that","has","been","replaced","by","a","neural","network",".","This","model","is","based","on","the","paper","``","Learning","the","exchange-correlation","functional","from","nature","with","fully","differentiable","density","functional","theory",".","''","and","is","listed","below","for","reference",".","To","read","more","about","Density","Functional","Theory","and","the","exchange","correlation","functional","please","check","the","references","below",".","Examples","--","--","--","--",">",">",">","from","deepchem.models.dft.dftxc","import","XCModel",">",">",">","from","deepchem.data.data_loader","import","DFTYamlLoader",">",">",">","inputs","=","'deepchem\/models\/tests\/assets\/test_dftxcdata.yaml'",">",">",">","data","=","DFTYamlLoader","(",")",">",">",">","dataset","=","data.create_dataset","(","inputs",")",">",">",">","dataset.get_shape","(",")","(","(","2",",",")",",","(","2",",",")",",","(","2",",",")",",","(","2",",",")",")",">",">",">","model","=","XCModel","(","``","lda_x","''",",","batch_size=1",")",">",">",">","loss","=","model.fit","(","dataset",",","nb_epoch=1",",","checkpoint_interval=1",")","The","6-311++G","(","3df,3pd",")","basis","for","atomz","3","does","not","exist",",","but","we","will","download","it","Downloaded","to","\/usr\/share\/miniconda3\/envs\/deepchem\/lib\/python3.8\/site-packages\/dqc\/api\/.database\/6-311ppg_3df_3pd_\/03.gaussian94","Notes","--","--","-","There","are","4","types","of","DFT","data","object","implementations","that","are","used","to","determine","the","type","of","calculation","to","be","carried","out","on","the","entry","object",".","These","types","are",":","``","ae","''",",","``","ie","''",",","``","dm","''",",","``","dens","''",",","that","stand","for","atomization","energy",",","ionization","energy",",","density","matrix","and","density","profile","respectively",".","The","entry","type","``","Density","Matrix","''","can","not","be","used","on","model.evaluate","as","of","now",".","To","run","predictions","on","this","data","type",",","a","dataset","containing","only","``","dm","''","entries","must","be","used",".","References","--","--","--","--","--","https",":","\/\/github.com\/deepchem\/deepchem\/blob\/3f06168a6c9c16fd90cde7f5246b94f484ea3890\/deepchem\/models\/dft\/nnxc.py","Encyclopedia","of","Condensed","Matter","Physics",",","2005",".","Kasim",",","Muhammad","F.",",","and","Sam","M.","Vinko",".","``","Learning","the","exchange-correlation","functional","from","nature","with","fully","differentiable","density","functional","theory",".","''","Physical","Review","Letters","127.12","(","2021",")",":","126403","."]
docstr: Method to compute inputs, labels and weight for the Torch Model.
  
  Parameters
  ----------
  batch: Tuple[Any, Any, Any]
  
  Returns
  ------
  Tuple[List[torch.Tensor], List[torch.Tensor], List[torch.Tensor]]
docstr_tok: ["Method","to","compute","inputs",",","labels","and","weight","for","the","Torch","Model",".","Parameters","--","--","--","--","--","batch",":","Tuple","[","Any",",","Any",",","Any","]","Returns","--","--","--","Tuple","[","List","[","torch.Tensor","]",",","List","[","torch.Tensor","]",",","List","[","torch.Tensor","]","]"]
code: def _prepare_batch(
      self, batch
  ) -> Tuple[List[Any], List[torch.Tensor], List[torch.Tensor]]:
      """
      Method to compute inputs, labels and weight for the Torch Model.
  
      Parameters
      ----------
      batch: Tuple[Any, Any, Any]
  
      Returns
      ------
      Tuple[List[torch.Tensor], List[torch.Tensor], List[torch.Tensor]]
      """
      inputs, labels, weights = batch
      if labels is not None:
          labels = [
              x.astype(np.float32) if x.dtype == np.float64 else x
              for x in labels
          ]
          label_tensors = [
              torch.as_tensor(
                  x, dtype=torch.float64, device=self.device
              ).requires_grad_()
              for x in labels
          ]
      else:
          label_tensors = []
      if weights is not None:
          weights = [
              x.astype(np.float32) if x.dtype == np.float64 else x
              for x in weights
          ]
          weight_tensors = [
              torch.as_tensor(
                  x, dtype=torch.float64, device=self.device
              )
              for x in weights
          ]
      else:
          weight_tensors = []
  
      return (inputs, label_tensors, weight_tensors)
  
file_path: deepchem/deepchem/models/dft/dftxc.py
imports: from deepchem.models.dft.scf import XCNNSCF
  import torch
  from deepchem.models.dft.nnxc import HybridXC
  from deepchem.models.losses import Loss, L2Loss
  from deepchem.models.torch_models.torch_model import TorchModel
  from typing import Tuple, Optional, List, Any
  import numpy
label_desc: Use image node_id 2 for calling the XCModel obj's underlying member method code with example usage: obj._prepare_batch(batch) and returns: inputs,  label_tensors,  weight_tensors