Commit d02e528d authored by ZHENQIN WU's avatar ZHENQIN WU
Browse files

max deg increased to 10

parent 295d6ff3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ def atom_features(atom, bool_id_feat=False):
         'Sb', 'Sn', 'Ag', 'Pd', 'Co', 'Se', 'Ti', 'Zn', 'H',    # H?
         'Li', 'Ge', 'Cu', 'Au', 'Ni', 'Cd', 'In', 'Mn', 'Zr',
         'Cr', 'Pt', 'Hg', 'Pb', 'Unknown']) +
        one_of_k_encoding(atom.GetDegree(), [0, 1, 2, 3, 4, 5, 6]) +
        one_of_k_encoding(atom.GetDegree(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) +
        one_of_k_encoding_unk(atom.GetTotalNumHs(), [0, 1, 2, 3, 4]) +
        one_of_k_encoding_unk(atom.GetImplicitValence(), [0, 1, 2, 3, 4, 5, 6]) +
        [atom.GetFormalCharge(), atom.GetNumRadicalElectrons()] +
+3 −3
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ class ConvMol(object):
  Resorts order of atoms internally to be in order of increasing degree. Note
  that only heavy atoms (hydrogens excluded) are considered here.
  """
  def __init__(self, atom_features, adj_list, max_deg=6, min_deg=0):
  def __init__(self, atom_features, adj_list, max_deg=10, min_deg=0):
    """
    Parameters
    ----------
@@ -223,7 +223,7 @@ class ConvMol(object):

  # TODO(rbharath): Can this be removed?
  @staticmethod
  def get_null_mol(n_feat, max_deg=6, min_deg=0):
  def get_null_mol(n_feat, max_deg=10, min_deg=0):
    """Constructs a null molecules

    Get one molecule with one atom of each degree, with all the atoms 
@@ -243,7 +243,7 @@ class ConvMol(object):
    return ConvMol(atom_features, canon_adj_list)

  @staticmethod
  def agglomerate_mols(mols, max_deg=6, min_deg=0):
  def agglomerate_mols(mols, max_deg=10, min_deg=0):
    """Concatenates list of ConvMol's into one mol object that can be used to feed 
    into tensorflow placeholders. The indexing of the molecules are preseved during the
    combination, but the indexing of the atoms are greatly changed.
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ def merge_dicts(l):

class GraphTopology(object):
  """Manages placeholders associated with batch of graphs and their topology"""
  def __init__(self, n_feat, name='topology', max_deg=6,
  def __init__(self, n_feat, name='topology', max_deg=10,
               min_deg=0):
    """
    Note that batch size is not specified in a GraphTopology object. A batch
+2 −2
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ class GraphConv(Layer):
  GraphTopology.get_input_placeholders().
  """
  def __init__(self, nb_filter, init='glorot_uniform', activation='linear',
               dropout=None, max_deg=6, min_deg=0, **kwargs):
               dropout=None, max_deg=10, min_deg=0, **kwargs):
    """
    Parameters
    ----------
@@ -388,7 +388,7 @@ class GraphPool(Layer):
  in bond-graph. Returns a tensor of the same size as the input.
  """

  def __init__(self, max_deg=6, min_deg=0, **kwargs):        
  def __init__(self, max_deg=10, min_deg=0, **kwargs):        
    """
    Parameters
    ----------
+3 −2
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ def benchmark_loading_datasets(hyper_parameters,
  #assigning featurizer
  if model in ['graphconv', 'graphconvreg']:
    featurizer = 'GraphConv'
    n_features = 71
    n_features = 75
  elif model in ['tf', 'tf_robust', 'logreg', 'rf', 'tf_regression']:
    featurizer = 'ECFP'
    n_features = 1024
@@ -548,7 +548,8 @@ if __name__ == '__main__':
                           'penalty': 0.0005, 'penalty_type': 'l2', 
                           'batch_size': 128, 'nb_epoch': 50, 
                           'learning_rate': 0.00008}]
  hps['graphconvreg'] = [{'batch_size': 128, 'nb_epoch': 50, 
  
  hps['graphconvreg'] = [{'batch_size': 128, 'nb_epoch': 20, 
                          'learning_rate': 0.0005, 'n_filters': 128, 
                          'n_fully_connected_nodes': 256, 'seed': 123}]

Loading