class_docstr: Lattice Convolutional Neural Network (LCNN).
  Here is a simple example of code that uses the LCNNModel with
  Platinum 2d Adsorption dataset.
  
  This model takes arbitrary configurations of Molecules on an adsorbate and predicts
  their formation energy. These formation energies are found using DFT calculations and
  LCNNModel is to automate that process. This model defines a crystal graph using the
  distance between atoms. The crystal graph is an undirected regular graph (equal neighbours)
  and different permutations of the neighbours are pre-computed using the LCNNFeaturizer.
  On each node for each permutation, the neighbour nodes are concatenated which are further operated.
  This model has only a node representation. Please confirm the detail algorithms from [1]_.
  
  Examples
  --------
  >>>
  >> import deepchem as dc
  >> from pymatgen.core import Structure
  >> import numpy as np
  >> from deepchem.feat import LCNNFeaturizer
  >> from deepchem.molnet import load_Platinum_Adsorption
  >> PRIMITIVE_CELL = {
  ..   "lattice": [[2.818528, 0.0, 0.0],
  ..               [-1.409264, 2.440917, 0.0],
  ..               [0.0, 0.0, 25.508255]],
  ..   "coords": [[0.66667, 0.33333, 0.090221],
  ..              [0.33333, 0.66667, 0.18043936],
  ..              [0.0, 0.0, 0.27065772],
  ..              [0.66667, 0.33333, 0.36087608],
  ..              [0.33333, 0.66667, 0.45109444],
  ..              [0.0, 0.0, 0.49656991]],
  ..   "species": ['H', 'H', 'H', 'H', 'H', 'He'],
  ..   "site_properties": {'SiteTypes': ['S1', 'S1', 'S1', 'S1', 'S1', 'A1']}
  .. }
  >> PRIMITIVE_CELL_INF0 = {
  ..    "cutoff": np.around(6.00),
  ..    "structure": Structure(**PRIMITIVE_CELL),
  ..    "aos": ['1', '0', '2'],
  ..    "pbc": [True, True, False],
  ..    "ns": 1,
  ..    "na": 1
  .. }
  >> tasks, datasets, transformers = load_Platinum_Adsorption(
  ..    featurizer= LCNNFeaturizer( **PRIMITIVE_CELL_INF0)
  .. )
  >> train, val, test = datasets
  >> model = LCNNModel(mode='regression',
  ..                   batch_size=8,
  ..                   learning_rate=0.001)
  >> model = LCNN()
  >> out = model(lcnn_feat)
  >> model.fit(train, nb_epoch=10)
  
  
  References
  ----------
  .. [1] Jonathan Lym and Geun Ho Gu, J. Phys. Chem. C 2019, 123, 18951−18959.
  
  Notes
  -----
  This class requires DGL and PyTorch to be installed.
docstr: Create batch data for LCNN.
  
  Parameters
  ----------
  batch: Tuple
      The tuple are `(inputs, labels, weights)`.
  
  Returns
  -------
  inputs: DGLGraph
      DGLGraph for a batch of graphs.
  labels: List[torch.Tensor] or None
      The labels converted to torch.Tensor
  weights: List[torch.Tensor] or None
      The weights for each sample or sample/task pair converted to torch.Tensor
docstr_tok: ["Create","batch","data","for","LCNN",".","Parameters","--","--","--","--","--","batch",":","Tuple","The","tuple","are","`","(","inputs",",","labels",",","weights",")","`",".","Returns","--","--","--","-","inputs",":","DGLGraph","DGLGraph","for","a","batch","of","graphs",".","labels",":","List","[","torch.Tensor","]","or","None","The","labels","converted","to","torch.Tensor","weights",":","List","[","torch.Tensor","]","or","None","The","weights","for","each","sample","or","sample\/task","pair","converted","to","torch.Tensor"]
code: def _prepare_batch(self, batch):
      """
      Create batch data for LCNN.
  
      Parameters
      ----------
      batch: Tuple
          The tuple are `(inputs, labels, weights)`.
  
      Returns
      -------
      inputs: DGLGraph
          DGLGraph for a batch of graphs.
      labels: List[torch.Tensor] or None
          The labels converted to torch.Tensor
      weights: List[torch.Tensor] or None
          The weights for each sample or sample/task pair converted to torch.Tensor
      """
      try:
          import dgl
      except:
          raise ImportError("This class requires DGL to be installed.")
  
      inputs, labels, weights = batch
      dgl_graphs = [graph.to_dgl_graph() for graph in inputs[0]]
      inputs = dgl.batch(dgl_graphs).to(self.device)
      _, labels, weights = super(LCNNModel, self)._prepare_batch(
          ([], labels, weights)
      )
      return inputs, labels, weights
  
imports: import torch
  import torch.nn
  from deepchem.models.torch_models.torch_model import TorchModel
  from deepchem.models.losses import L2Loss
label_desc: Use image node_id 2 for calling the LCNNModel obj's underlying member method code with example usage: obj._prepare_batch(batch) and returns: inputs,  labels,  weights