gabrielbianchin commited on
Commit
4fee7bd
·
1 Parent(s): 72fa1d9
classification/tokenizer_bbb.py CHANGED
@@ -55,6 +55,7 @@ class BBBTokenizer(PreTrainedTokenizer):
55
  maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
56
  tab_input = np.concatenate([rdkit_2d, maccs])
57
  tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
 
58
  return torch.tensor(tab_input, dtype=torch.float32)
59
 
60
  def generate_img_features(self, smiles):
 
55
  maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
56
  tab_input = np.concatenate([rdkit_2d, maccs])
57
  tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
58
+ tab_input = np.clip(tab_input, -1e3, 1e3)
59
  return torch.tensor(tab_input, dtype=torch.float32)
60
 
61
  def generate_img_features(self, smiles):
regression/tokenizer_bbb.py CHANGED
@@ -55,6 +55,7 @@ class BBBTokenizer(PreTrainedTokenizer):
55
  maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
56
  tab_input = np.concatenate([rdkit_2d, maccs])
57
  tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
 
58
  return torch.tensor(tab_input, dtype=torch.float32)
59
 
60
  def generate_img_features(self, smiles):
 
55
  maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
56
  tab_input = np.concatenate([rdkit_2d, maccs])
57
  tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
58
+ tab_input = np.clip(tab_input, -1e3, 1e3)
59
  return torch.tensor(tab_input, dtype=torch.float32)
60
 
61
  def generate_img_features(self, smiles):
tokenizer_bbb.py CHANGED
@@ -55,6 +55,7 @@ class BBBTokenizer(PreTrainedTokenizer):
55
  maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
56
  tab_input = np.concatenate([rdkit_2d, maccs])
57
  tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
 
58
  return torch.tensor(tab_input, dtype=torch.float32)
59
 
60
  def generate_img_features(self, smiles):
 
55
  maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
56
  tab_input = np.concatenate([rdkit_2d, maccs])
57
  tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
58
+ tab_input = np.clip(tab_input, -1e3, 1e3)
59
  return torch.tensor(tab_input, dtype=torch.float32)
60
 
61
  def generate_img_features(self, smiles):