Huhujingjing commited on
Commit
27fdc8e
1 Parent(s): 263ef5a

Upload model

Browse files
Files changed (1) hide show
  1. modeling_mxm.py +30 -30
modeling_mxm.py CHANGED
@@ -18,7 +18,7 @@ from torch_scatter import scatter
18
  from torch_geometric.nn import global_add_pool, radius
19
  from torch_sparse import SparseTensor
20
 
21
- from mxm_model.configuration_mxm import MXMConfig
22
 
23
  from tqdm import tqdm
24
  import numpy as np
@@ -911,35 +911,35 @@ class Local_MP(torch.nn.Module):
911
  return h, y
912
 
913
 
914
- # class MXMConfig(PretrainedConfig):
915
- # model_type = "gcn"
916
- #
917
- # def __init__(
918
- # self,
919
- # dim: int=128,
920
- # n_layer: int=6,
921
- # cutoff: float=5.0,
922
- # num_spherical: int=7,
923
- # num_radial: int=6,
924
- # envelope_exponent: int=5,
925
- #
926
- # smiles: List[str] = None,
927
- # processor_class: str = "SmilesProcessor",
928
- # **kwargs,
929
- # ):
930
- #
931
- # self.dim = dim # the dimension of input feature
932
- # self.n_layer = n_layer # the number of GCN layers
933
- # self.cutoff = cutoff # the cutoff distance for neighbor searching
934
- # self.num_spherical = num_spherical # the number of spherical harmonics
935
- # self.num_radial = num_radial # the number of radial basis
936
- # self.envelope_exponent = envelope_exponent # the envelope exponent
937
- #
938
- # self.smiles = smiles # process smiles
939
- # self.processor_class = processor_class
940
- #
941
- #
942
- # super().__init__(**kwargs)
943
 
944
 
945
 
 
18
  from torch_geometric.nn import global_add_pool, radius
19
  from torch_sparse import SparseTensor
20
 
21
+ # from mxm_model.configuration_mxm import MXMConfig
22
 
23
  from tqdm import tqdm
24
  import numpy as np
 
911
  return h, y
912
 
913
 
914
+ class MXMConfig(PretrainedConfig):
915
+ model_type = "mxm"
916
+
917
+ def __init__(
918
+ self,
919
+ dim: int=128,
920
+ n_layer: int=6,
921
+ cutoff: float=5.0,
922
+ num_spherical: int=7,
923
+ num_radial: int=6,
924
+ envelope_exponent: int=5,
925
+
926
+ smiles: List[str] = None,
927
+ processor_class: str = "SmilesProcessor",
928
+ **kwargs,
929
+ ):
930
+
931
+ self.dim = dim # the dimension of input feature
932
+ self.n_layer = n_layer # the number of GCN layers
933
+ self.cutoff = cutoff # the cutoff distance for neighbor searching
934
+ self.num_spherical = num_spherical # the number of spherical harmonics
935
+ self.num_radial = num_radial # the number of radial basis
936
+ self.envelope_exponent = envelope_exponent # the envelope exponent
937
+
938
+ self.smiles = smiles # process smiles
939
+ self.processor_class = processor_class
940
+
941
+
942
+ super().__init__(**kwargs)
943
 
944
 
945