Commit fd068626 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

cleanup

parent ae927734
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ import hashlib

logger = logging.getLogger(__name__)


def hash_ecfp(ecfp, size):
  """
  Returns an int < size representing given ECFP fragment.
@@ -28,6 +29,7 @@ def hash_ecfp(ecfp, size):
  ecfp_hash = int(digest, 16) % (size)
  return (ecfp_hash)


def hash_ecfp_pair(ecfp_pair, size):
  """Returns an int < size representing that ECFP pair.

@@ -52,9 +54,8 @@ def hash_ecfp_pair(ecfp_pair, size):
  ecfp_hash = int(digest, 16) % (size)
  return (ecfp_hash)

def vectorize(hash_function,
              feature_dict=None,
              size=1024):

def vectorize(hash_function, feature_dict=None, size=1024):
  """Helper function to vectorize a spatial description from a hash.

  Hash functions are used to perform spatial featurizations in
@@ -80,8 +81,7 @@ def vectorize(hash_function,
  feature_vector = np.zeros(size)
  if feature_dict is not None:
    on_channels = [
        hash_function(feature, size)
        for key, feature in feature_dict.items()
        hash_function(feature, size) for key, feature in feature_dict.items()
    ]
    feature_vector[on_channels] += 1

+0 −4
Original line number Diff line number Diff line
@@ -12,11 +12,7 @@ delaney_tasks, delaney_datasets, transformers = dc.molnet.load_delaney(
    featurizer='smiles2img', split='index', img_spec="engd")
train_dataset, valid_dataset, test_dataset = delaney_datasets

<<<<<<< HEAD
# Get Metric
=======
# Get Metric 
>>>>>>> Model restore example
metric = dc.metrics.Metric(dc.metrics.pearson_r2_score, np.mean)

model = dc.models.ChemCeption(