class_docstr: Neural network xc functional of LDA
  
  Local-density approximations (LDA) are a class of approximations to the
  exchange–correlation (XC) energy. The LDA assumes variations of the
  density to be gradual, i.e, it is  based on the homogeneous electron
  gas model. Which is why it is regarded as the simplest approach to the
  exchange correlation functional. This class of functionals depend only
  upon the value of the electronic density at each point in space.
  
  Hence, in this model, we only input the density and not other components
  such as the gradients of the density (which is used in other functionals
  such as the GGA class).
  
  Examples
  --------
  >>> from deepchem.models.dft.nnxc import NNLDA
  >>> import torch
  >>> import torch.nn as nn
  >>> n_input, n_hidden = 2, 1
  >>> nnmodel = (nn.Linear(n_input, n_hidden))
  >>> output = NNLDA(nnmodel)
  
  References
  ----------
  Density-Functional Theory of the Electronic Structure of Molecules,Robert
  G. Parr and Weitao Yang, Annual Review of Physical Chemistry 1995 46:1,
  701-728
  R. O. Jones and O. Gunnarsson, Rev. Mod. Phys. 61, 689 (1989)
class_docstr_tok: ["Neural","network","xc","functional","of","LDA","Local-density","approximations","(","LDA",")","are","a","class","of","approximations","to","the","exchange\u2013correlation","(","XC",")","energy",".","The","LDA","assumes","variations","of","the","density","to","be","gradual",",","i.e",",","it","is","based","on","the","homogeneous","electron","gas","model",".","Which","is","why","it","is","regarded","as","the","simplest","approach","to","the","exchange","correlation","functional",".","This","class","of","functionals","depend","only","upon","the","value","of","the","electronic","density","at","each","point","in","space",".","Hence",",","in","this","model",",","we","only","input","the","density","and","not","other","components","such","as","the","gradients","of","the","density","(","which","is","used","in","other","functionals","such","as","the","GGA","class",")",".","Examples","--","--","--","--",">",">",">","from","deepchem.models.dft.nnxc","import","NNLDA",">",">",">","import","torch",">",">",">","import","torch.nn","as","nn",">",">",">","n_input",",","n_hidden","=","2",",","1",">",">",">","nnmodel","=","(","nn.Linear","(","n_input",",","n_hidden",")",")",">",">",">","output","=","NNLDA","(","nnmodel",")","References","--","--","--","--","--","Density-Functional","Theory","of","the","Electronic","Structure","of","Molecules",",","Robert","G.","Parr","and","Weitao","Yang",",","Annual","Review","of","Physical","Chemistry","1995","46:1",",","701-728","R.","O.","Jones","and","O.","Gunnarsson",",","Rev",".","Mod",".","Phys",".","61",",","689","(","1989",")"]
code: def __init__(self, nnmodel: torch.nn.Module):
      super().__init__()
      """
          Parameters
          ----------
          nnmodel: torch.nn.Module
              Neural network for xc functional
          """
      self.nnmodel = nnmodel
  
imports: from abc import abstractmethod
  from typing import Union, List
  import torch
  from dqc.utils.datastruct import ValGrad
  from deepchem.utils.dftutils import SpinParam
  from dqc.api.getxc import get_xc
  from dqc.xc.base_xc import BaseXC
  from dqc.utils.safeops import safenorm, safepow
label_desc: Use image node_id 1 to create a new NNLDA object from inherited base classes: BaseNNXC with example: obj = NNLDA(nnmodel)