class_docstr: A deep-learning based Variational Monte Carlo method [1]_ for calculating the ab-initio
  solution of a many-electron system.
  
  This model must be pre-trained on the HF baseline and then can be used to improve on it using electronic interactions
  via the learned electron distance features. Ferminet models the orbital values using envelope functions and the
  calculated electron features, which can then be used to approximate the wavefunction for better sampling of electrons.
  
  Example
  -------
  >>> import numpy as np
  >>> import deepchem as dc
  >>> from deepchem.models.torch_models.ferminet import Ferminet
  >>> import torch
  >>> H2_molecule =  torch.Tensor([[0, 0, 0.748], [0, 0, 0]])
  >>> H2_charge = torch.Tensor([[1], [1]])
  >>> model = Ferminet(nucleon_pos=H2_molecule, nuclear_charge=H2_charge, spin=0, batch_size=1)
  >>> electron = np.random.rand(1, 2*3)
  >>> wavefunction = model.forward(electron)
  
  References
  ----------
  .. [1] Spencer, James S., et al. Better, Faster Fermionic Neural Networks. arXiv:2011.07125, arXiv, 13 Nov. 2020. arXiv.org, http://arxiv.org/abs/2011.07125.
class_docstr_tok: ["A","deep-learning","based","Variational","Monte","Carlo","method","[","1","]","_","for","calculating","the","ab-initio","solution","of","a","many-electron","system",".","This","model","must","be","pre-trained","on","the","HF","baseline","and","then","can","be","used","to","improve","on","it","using","electronic","interactions","via","the","learned","electron","distance","features",".","Ferminet","models","the","orbital","values","using","envelope","functions","and","the","calculated","electron","features",",","which","can","then","be","used","to","approximate","the","wavefunction","for","better","sampling","of","electrons",".","Example","--","--","--","-",">",">",">","import","numpy","as","np",">",">",">","import","deepchem","as","dc",">",">",">","from","deepchem.models.torch_models.ferminet","import","Ferminet",">",">",">","import","torch",">",">",">","H2_molecule","=","torch.Tensor","(","[","[","0",",","0",",","0.748","]",",","[","0",",","0",",","0","]","]",")",">",">",">","H2_charge","=","torch.Tensor","(","[","[","1","]",",","[","1","]","]",")",">",">",">","model","=","Ferminet","(","nucleon_pos=H2_molecule",",","nuclear_charge=H2_charge",",","spin=0",",","batch_size=1",")",">",">",">","electron","=","np.random.rand","(","1",",","2","*","3",")",">",">",">","wavefunction","=","model.forward","(","electron",")","References","--","--","--","--","--","..","[","1","]","Spencer",",","James","S.",",","et","al",".","Better",",","Faster","Fermionic","Neural","Networks",".","arXiv:2011.07125",",","arXiv",",","13","Nov.","2020.","arXiv.org",",","http",":","\/\/arxiv.org\/abs\/2011.07125","."]
docstr: Parameters:
  -----------
  nucleon_pos: torch.Tensor
      tensor containing the nucleons coordinates, it is in the shape of (number of atoms, 3)
  nuclear_charge: torch.Tensor
      tensor containing the electron number associated with each nucleon, it is in the shape of (number of atoms, no_of_electron)
  n_one: List
      List of hidden units for the one-electron stream in each layer
  n_two: List
      List of hidden units for the two-electron stream in each layer
  determinant: int
      Number of determinants for the final solution
  batch_size: int
      Number of molecule samples to be in each batch
  
  Attributes
  ----------
  running_diff: torch.Tensor
      torch tensor containing the loss which gets updated for each random walk performed
  ferminet_layer: torch.nn.ModuleList
      Modulelist containing the ferminet electron feature layer
  ferminet_layer_envelope: torch.nn.ModuleList
      Modulelist containing the ferminet envelope electron feature layer
  nuclear_nuclear_potential: torch.Tensor
      Torch tensor containing the inter-nuclear potential in the molecular system
docstr_tok: ["Parameters",":","--","--","--","--","--","-","nucleon_pos",":","torch.Tensor","tensor","containing","the","nucleons","coordinates",",","it","is","in","the","shape","of","(","number","of","atoms",",","3",")","nuclear_charge",":","torch.Tensor","tensor","containing","the","electron","number","associated","with","each","nucleon",",","it","is","in","the","shape","of","(","number","of","atoms",",","no_of_electron",")","n_one",":","List","List","of","hidden","units","for","the","one-electron","stream","in","each","layer","n_two",":","List","List","of","hidden","units","for","the","two-electron","stream","in","each","layer","determinant",":","int","Number","of","determinants","for","the","final","solution","batch_size",":","int","Number","of","molecule","samples","to","be","in","each","batch","Attributes","--","--","--","--","--","running_diff",":","torch.Tensor","torch","tensor","containing","the","loss","which","gets","updated","for","each","random","walk","performed","ferminet_layer",":","torch.nn.ModuleList","Modulelist","containing","the","ferminet","electron","feature","layer","ferminet_layer_envelope",":","torch.nn.ModuleList","Modulelist","containing","the","ferminet","envelope","electron","feature","layer","nuclear_nuclear_potential",":","torch.Tensor","Torch","tensor","containing","the","inter-nuclear","potential","in","the","molecular","system"]
code: def __init__(
      self,
      nucleon_pos: torch.Tensor,
      nuclear_charge: torch.Tensor,
      spin: tuple,
      n_one: List = [256, 256, 256, 256],
      n_two: List = [32, 32, 32, 32],
      determinant: int = 16,
      batch_size: int = 8,
  ) -> None:
      """
      Parameters:
      -----------
      nucleon_pos: torch.Tensor
          tensor containing the nucleons coordinates, it is in the shape of (number of atoms, 3)
      nuclear_charge: torch.Tensor
          tensor containing the electron number associated with each nucleon, it is in the shape of (number of atoms, no_of_electron)
      n_one: List
          List of hidden units for the one-electron stream in each layer
      n_two: List
          List of hidden units for the two-electron stream in each layer
      determinant: int
          Number of determinants for the final solution
      batch_size: int
          Number of molecule samples to be in each batch
  
      Attributes
      ----------
      running_diff: torch.Tensor
          torch tensor containing the loss which gets updated for each random walk performed
      ferminet_layer: torch.nn.ModuleList
          Modulelist containing the ferminet electron feature layer
      ferminet_layer_envelope: torch.nn.ModuleList
          Modulelist containing the ferminet envelope electron feature layer
      nuclear_nuclear_potential: torch.Tensor
          Torch tensor containing the inter-nuclear potential in the molecular system
      """
      super(Ferminet, self).__init__()
      if len(n_one) != len(n_two):
          raise ValueError(
              "The number of layers in one-electron and two-electron stream should be equal"
          )
      else:
          self.layers = len(n_one)
  
      self.nucleon_pos = nucleon_pos
      self.determinant = determinant
      self.batch_size = batch_size
      self.spin = spin
      self.total_electron = spin[0] + spin[1]
      self.nuclear_charge = nuclear_charge
      self.n_one = n_one
      self.n_two = n_two
      self.ferminet_layer: torch.nn.ModuleList = torch.nn.ModuleList()
      self.ferminet_layer_envelope: torch.nn.ModuleList = (
          torch.nn.ModuleList()
      )
      self.running_diff: torch.Tensor = torch.zeros(self.batch_size)
      self.nuclear_nuclear_potential: torch.Tensor = (
          self.calculate_nuclear_nuclear()
      )
  
      self.ferminet_layer.append(
          FerminetElectronFeature(
              self.n_one,
              self.n_two,
              self.nucleon_pos.size()[0],
              self.batch_size,
              self.total_electron,
              [self.spin[0], self.spin[1]],
          )
      )
      self.ferminet_layer_envelope.append(
          FerminetEnvelope(
              self.n_one,
              self.n_two,
              self.total_electron,
              self.batch_size,
              [self.spin[0], self.spin[1]],
              self.nucleon_pos.size()[0],
              self.determinant,
          )
      )
  
imports: import logging
  from typing import List, Optional, Tuple
  from rdkit import Chem
  import numpy
  from deepchem.utils.molecule_feature_utils import ALLEN_ELECTRONEGATIVTY
  from deepchem.models.torch_models import TorchModel
  import torch
  from deepchem.models.torch_models.layers import FerminetElectronFeature, FerminetEnvelope
  from deepchem.utils.electron_sampler import ElectronSampler
label_desc: Use image node_id 1 to create a new Ferminet object from inherited base classes: torch.nn with example: obj = Ferminet(nucleon_pos, nuclear_charge, spin, n_one, n_two, determinant, batch_size)