class_docstr: The HybridXC module computes XC energy by summing XC energy computed
  from libxc(any conventional DFT functional) and the trainable neural
  network with tunable weights.
  This layer constructs a hybrid functional based on the user's choice
  of what model is to be used to train the functional. (Currently, we only
  support an LDA based model). This hybrid functional is a combination of
  the xc that is trained by a neural network, and a conventional DFT
  functional.
  
  Examples
  --------
  >>> from deepchem.models.dft.nnxc import HybridXC
  >>> import torch
  >>> import torch.nn as nn
  >>> n_input, n_hidden = 2, 1
  >>> nnmodel = (nn.Linear(n_input, n_hidden))
  >>> output = HybridXC("lda_x", nnmodel, aweight0=0.0)
class_docstr_tok: ["The","HybridXC","module","computes","XC","energy","by","summing","XC","energy","computed","from","libxc","(","any","conventional","DFT","functional",")","and","the","trainable","neural","network","with","tunable","weights",".","This","layer","constructs","a","hybrid","functional","based","on","the","user","'s","choice","of","what","model","is","to","be","used","to","train","the","functional",".","(","Currently",",","we","only","support","an","LDA","based","model",")",".","This","hybrid","functional","is","a","combination","of","the","xc","that","is","trained","by","a","neural","network",",","and","a","conventional","DFT","functional",".","Examples","--","--","--","--",">",">",">","from","deepchem.models.dft.nnxc","import","HybridXC",">",">",">","import","torch",">",">",">","import","torch.nn","as","nn",">",">",">","n_input",",","n_hidden","=","2",",","1",">",">",">","nnmodel","=","(","nn.Linear","(","n_input",",","n_hidden",")",")",">",">",">","output","=","HybridXC","(","``","lda_x","''",",","nnmodel",",","aweight0=0.0",")"]
code: def __init__(
      self,
      xcstr: str,
      nnmodel: torch.nn.Module,
      aweight0: float = 0.0,
      bweight0: float = 1.0,
  ):
      super().__init__()
      """
          Parameters
          ----------
          xcstr: str
              The choice of xc to use. Some of the commonly used ones are:
              lda_x, lda_c_pw, lda_c_ow, lda_c_pz, lda_xc_lp_a, lda_xc_lp_b.
              The rest of the possible values can be found under the
              "LDA Functionals" section in the reference given below.
          nnmodel: nn.Module
              trainable neural network for prediction xc energy.
          aweight0: float
              weight of the neural network
          bweight0: float
              weight of the default xc
  
          References
          ----------
          https://tddft.org/programs/libxc/functionals/
          """
      self.xc = get_xc(xcstr)
      family = self.xc.family
      if family == 1:
          self.nnxc = NNLDA(nnmodel)
      else:
          self.nnxc = NNPBE(nnmodel)
      self.aweight = torch.nn.Parameter(
          torch.tensor(aweight0, requires_grad=True)
      )
      self.bweight = torch.nn.Parameter(
          torch.tensor(bweight0, requires_grad=True)
      )
      self.weight_activation = torch.nn.Identity()
  
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 HybridXC object from inherited base classes: BaseNNXC with example: obj = HybridXC(xcstr, nnmodel, aweight0, bweight0)